To maintain user details and subscriber information in a contact profile, use the Collect Tracking Code feature in Marketing Cloud Engagement.
The setUserInfo push passes the Contact ID. Regardless of the type of ID chosen, use the email label for this field and add the value in the SetUserInfo snippet. You don’t need to add it to every page because adding it once ties the known identifier to the Collect Tracking Code cookie.
Tip Configure Collect Tracking Code to store subscriber information when a
contact enters an email address on the website or clicks through a marketing email. To
use the Personalization Builder Integrations, you must use the user’s email address.
For privacy reasons, avoid using a personally identifiable information (PII) identifier
or hashing the email.
Set User Info
<script type="text/javascript">
_etmc.push(["setOrgId", "MID"]);
_etmc.push(["setUserInfo", {
"email": "INSERT_EMAIL_OR_UNIQUE_ID"
}]);
_etmc.push(["trackPageView"]);
</script>
Tip Add this call everywhere that a user logs in or becomes known, such as
login pages and sign-up pages.
-
Copy and customize the script by replacing
INSERT_EMAIL_OR_UNIQUE_IDwith dynamic code to get the Subscriber ID. A Subscriber ID is typically an email address or number unique to that user. - Add the modified script in the header code on your pages.