Anonymous Tracking

Prev Next

1 Overview

Anonymous tracking allows you to collect website data without storing any user-identifiable information, such as cookies or personal IDs. This setup can help you comply with privacy regulations while still gaining insights into user behavior.

With the Smart Pixel, anonymous tracking works by:

  • Preventing the setting of user-identifiable cookies (e.g., eid, sid)

  • Suppressing specific query parameters that could contain identifiable data

  • Indicating anonymous requests in the tracking call via the nc=1 parameter

Note: This will limit your ability to analyze returning users. Cohort analyses, customer journeys, or any cross-session reports won’t be available.


2 Configuration

Before using anonymous tracking, enable the relevant options in the advanced configuration.

wtSmart.advanced.add({
  userIdentification: {
    enableAnonymousFunction: true,
    anonymousCookieName: 'miCookieOptOut',
    anonymousOptIn: false,
    suppressParameter: ['cd', 'uc5', 'uc7']
  }
});

Configuration Option

Description

Default

enableAnonymousFunction

Enables the opt-out of user-identifiable tracking. When enabled, users can switch between anonymous and identifiable tracking.

false

anonymousCookieName

Optional custom name for the anonymous tracking cookie.

miCookieOptOut

anonymousOptIn

Enables anonymous tracking by default. The pixel won’t set any identifiable cookie unless the user opts in.

false

suppressParameter

Defines which tracking parameters are suppressed when anonymous tracking is active.

Empty array


3 Switching Tracking Modes

3.1 Default Behavior: Track Identifiable Users (anonymousOptIn = false)

User-identifiable tracking is used by default. Users can opt out by setting the anonymous cookie.

// Set anonymous tracking cookie (duration in minutes, optional)
wtSmart.utils.optout.setAnonymousCookie();

This activates anonymous tracking. The default duration is 5 years but can be changed.

// Delete the anonymous tracking cookie
wtSmart.utils.optout.deleteAnonymousCookie();

This reactivates user-identifiable tracking.

Example

<head>
     <title>Title of the document</title>
     <script type="text/javascript" async src="js/loader.min.js"></script>
     <script type="text/javascript">
         window.wtSmart = window.wtSmart || [];
             window.wtSmart.push( function (wtSmart) {
              
                 // set initial tracking config
                 wtSmart.init.set({
                     trackId: '###your TrackID###',
                     trackDomain: '###your TrackDomain###'
                 });
 
                 // enable and configure anonymous tracking
                 wtSmart.advanced.add({
                     userIdentification: {
                     enableAnonymousFunction: true ,
                     anonymousCookieName: 'miCookieOptOut',
                     anononymousOptIn: false,
                     suppressParameter: ['cd', 'uc5', 'uc7']
                     }  
                 });
 
                 // sample customer data
                 wtSmart.customer.data.add({
                     id: 'user5684798169',
                     category: {
                         5: 'User cat 5',
                         7: 'User cat 7'
                     }
     
                 });
          
             // send tracking data
                 wtSmart.track();
             });
         </script>
     </head>
 
     <body>       
         //opt-out of user-identifiable tracking
         <a href="#" onclick="wtSmart.utils.optout.setAnonymousCookie();">
		     <p>Opt-out of user identifiers for 5 years</p>
		 </a>
         
         //opt-in to user-identifiable tracking
         <a href="#" onclick="wtSmart.utils.optout.deleteAnonymousCookie();">
		     <p>Opt- in to tracking with user identifiers</p>
		 </a>
     </body>

3.2 Anonymous by Default: Track Only After Consent (anonymousOptIn = true)

Anonymous tracking is used by default. Users must opt in to enable user-identifiable tracking.

// Set user-identifiable tracking cookie (duration optional)
wtSmart.utils.optout.setAnonymousCookie();
// Delete the user-identifiable tracking cookie
wtSmart.utils.optout.deleteAnonymousCookie();

This reactivates user-identifiable tracking.

Example

<head>
     <title>Title of the document</title>
     <script type="text/javascript" async src="js/loader.min.js"></script>
     <script type="text/javascript">
         window.wtSmart = window.wtSmart || [];
             window.wtSmart.push( function (wtSmart) {
              
                 // set initial tracking config
                 wtSmart.init.set({
                     trackId: '###your TrackID###' ,
                     trackDomain: '###your TrackDomain###'
                 });
 
                 // enable and configure anonymous tracking
                 wtSmart.advanced.add({
                     userIdentification: {
                     enableAnonymousFunction: true,
                     anonymousCookieName: 'miCookieOptOut',
                     anononymousOptIn: true,
                     suppressParameter: ['cd', 'uc5', 'uc7']
                     }  
                 });
 
                 // sample customer data
                 wtSmart.customer.data.add({
                     id: 'user5684798169',
                     category: {
                         5: 'User cat 5',
                         7: 'User cat 7'
                     }
     
                 });
          
             // send tracking data
                 wtSmart.track();
             });
         </script>
     </head>
 
     <body>       
         //Agree to user-identifiable tracking
         <a href="#" onclick="wtSmart.utils.optout.setAnonymousCookie();">
		     <p>Agree to user identifiers for 5 years</p>
		 </a>
         
         //opt-out of user-identifiable tracking
         <a href="#" onclick="wtSmart.utils.optout.deleteAnonymousCookie();">
		     <p>Return to default tracking without user identifiers</p>
		 </a>
     </body>

4 How to Test Anonymous Tracking

If anonymous tracking is enabled, verify it as follows:

  • In Storage → Cookies, miCookieOptOut is set to 1

  • No user-identifiable cookie (e.g., eid) is stored

  • In Network, the request includes nc=1 and omits eid

  • Any configured parameters (e.g., cd, uc5) are not sent