By default, Emarsys uses cookies to keep track of website visitors. However, in order to match visitors with contacts in your contact database we have to explicitly identify known visitors, such as logged-in users or otherwise anonymous visitors who enter their email address on your website. This is the basis of cross-device user identification.
- To learn more about how Emarsys identifies your visitors, see: How are contacts identified?
- To learn more about how Web Extend processes user data from a data protection standpoint, see: GDPR and Web Extend - all you need to know.
There are two alternative JavaScript API commands you can use to identify known visitors:
- setEmail, which uses the visitor’s email address for identification.
- setCustomerId (default), which uses a user ID for identification.
Proper encryption is absolutely a must if you are using any Personally Identifiable Information.
Select one of these identification options and add the appropriate command to all the pages whenever your visitor can be explicitly identified.
Important
- Whichever option you choose, make sure to use only one of them for user identification throughout your website and not to mix them!
- Make sure that the JavaScript API commands are never cached. In most template-based webshop engines caching is set on specific paths – always make sure that the templates in which you implement these API commands are never in a cached path, as this will cause the API to report erroneous data.
- If you would like to change the contact identification method from
setEmail
(i.e. email hash) tosetCustomerID
(i.e. customer ID) or the other way around, please contact Emarsys Support. - If you change the contact identification method from
setEmail
(i.e. email hash) tosetCustomerID
(i.e. customer ID) or the other way around in your Web Extend configuration, then your Web Channel audiences will be empty and the contacts who had previously entered your Web Channel Automation Center program will not be able to see your campaigns anymore.
Check if it works
To see if user identification works properly on your website, do the following:
- In your browser, open a page on your website.
- Open another tab in your browser, log in to your Emarsys account, go to Management > Predict Data Sources > Web Behavior and click Live Events in the upper right-hand corner. This will open the Live Events page.
- Select my visit in the second drop-down.
- You should see an event box containing a cookie ID, a UTC timestamp and the referring URL.
- If you explicitly identified your visitor with the
setEmail
command, you should also see an email hash here.
- If you explicitly identified your visitor with the
setCustomerId
command, you should also see the customer ID here.
You can also install our Inspector Gadget bookmarklet that allows you to monitor live the Web Extend commands called on your website. If you implemented the tracking code and user identification correctly, the Inspector Gadget overlay will appear in your browser tab whenever you open a page on your website. The overlay will be either empty or showing the user identification command, if issued.
Please note that even if your implementation works properly you will see error messages on the Data Sources page at this stage. If you do not need to implement the e-commerce commands, you can simply disregard them.