How do I use site tracking to identify a user for event tracking?

I have event tracking setup and working as per this video: https://www.youtube.com/watch?v=bNkjmoZYCIU

It uses Google Tag Manager to fire an event and send the info to AC through the event tracking API. The information it sends is “email”, “event”, and “eventdata”.

This works great for users who login to my site or submit a form, but it cannot track events for users who visit my site through an AC email link. This is because when they visit by clicking an AC email link I do not have an email address to identify the user.

Since site tracking is able to identify a user through an AC email link is there anyway to grab that identifiable information and use it for my event tracking API? Maybe there is some sort of customer ID hash I can use?

1 Like

Hey @elementpaints46295,

There isn’t a way to deconstruct the site tracking cookie unfortunately, however there is a way to set the user’s email as a variable in the dataLayer, if you use a query string to append it to links in your email.

Then in GTM, write a script that parses the query string parameter and sets the variable in the data layer.

Be sure to tell GA to ignore the query string parameter though to keep PII off of your GA account!

1 Like