Smart Pixel - Anonymous Tracking
    • 4 Minutes to read
    • Dark
      Light

    Smart Pixel - Anonymous Tracking

    • Dark
      Light

    Article summary

    Due to local regulations and data privacy restrictions, it is possible that you want to track website usage without collecting any information that can be used to identify the user. With Intelligence' Smart Pixel, it is possible to opt-out of the following cookies that are used to identify a user:

    • eid: Used to identify a user across multiple sessions

    • sid: Used to identify during a single session

    • Categories and parameters: Additionally, the customer can exclude any query parameter of the Pixel. 

    Tracking Restrictions

    Please note that using this setting will affect your tracking data and the quality of any analyses that is based on returning visitors, for example, cohort analyses, customer journeys, and any cross-session analyses based on a visitor filter or segment. Please contact your account manager if you are in doubt before activating this feature.

    For more information, please see  What is Anonymized (aka Cookieless) Tracking?

    Step 1: Anonymous Tracking - Configuration

    Before being able to suppress cookies and parameters, you need to enable user identification opt-out in advanced configuration:

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

    Configuration Option

    Description

    Default

    enableAnonymousFunction

    Enables opting-out of user identification. If this configuration option is set to false, calling the opting-out function (Step 2) will not work and user identification is still on.

    When activated, the default implementation will still set the user-identifiable cookie, but will give the user the option to opt-out of its usage. If you want to start anonymous tracking by default, you need to set "anonymousOptIn" to "true".

    false

    anonymousCookieName

    An alternative name for the anonymous tracking cookie. If this cookie is set to 1, anonymous tracking is used.

    miCookieOptOut

    anonymousOptIn

    When activated, the pixel will not set any user-identifiable cookie until the user actively agrees to its usage.

    false

    suppressParameter

    It is possible to exclude additional parameters if the user sets the user-identifiable opt-out cookie. Please indicate the respective parameters in the array.

    empty

    Step 2: Anonymous Tracking - Methods

    Setting anonymousOptIn = false (default)

    This setting uses the user-identifiable cookies by default and gives the user the option to opt-out of its usage.

    Opt-Out of User-Identifiable Tracking

    You can call the following method to opt-out of user-identifiable tracking ( Utils). Setting this cookie when user-identifiable tracking is the default option will start tracking the user without any user-identifiable cookies:

    /**
     * @param {number} [duration=5*12*30*24*60]
     */
    wtSmart.utils.optout.setAnonymousCookie(duration);

    The default duration of the anonymous tracking cookie is five years, but you can change it to any other duration in the function.

    Opt-In to User-Identifiable Tracking

    Deleting the anonymous cookie will opt-in of user-identifiable tracking.

    wtSmart.utils.optout.deleteAnonymousCookie();

    Setting anonymousOptIn = true

    This setting uses anonymous tracking by default and gives the user the option to agree to user-identifiable tracking. Setting the anonymous cookie will start user-identifiable tracking.

    Agree to User-Identifiable Tracking

    /**
     * @param {number} [duration=5*12*30*24*60]
     */
    wtSmart.utils.optout.setAnonymousCookie(duration);

    Opt-Out of User-Identifiable Tracking

    Deleting the anonymous cookie will opt-out of user-identifiable tracking.

    wtSmart.utils.optout.deleteAnonymousCookie();

    Step 3: Anonymous Tracking - Test Functionality

    If the user opted-out of tracking with user-identifiable parameters, the following configuration can be seen in the developer console of your browser:

    • In Storage → cookies, you can see the miCookieOptOut is set to 1.

    • No user identifiable cookie is stored in the storage.

    • In Network, the request is displayed with the parameter "nc=1" and without the "eid" one.

    • If additional parameters are defined in the configuration, these are also suppressed in the requests.

    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: 'URM cat 5',
                             7: 'URM 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>
    <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: 'URM cat 5',
                             7: 'URM 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>


    Was this article helpful?