- 1 The problem:
- 2 The solution:
- 2.1 Step 1: Create the Custom dimension withing Google Analytics
- 2.2 Step 2: Create the trigger, variable and tags in GTM
- 2.3 Step 3: Set Mailchimp to use eCommerce360 Link Tracking
- 2.4 Step 4: Test out your new tag!
- 2.5 Step 5: Check Visitor ID in Google Analytics
The problem:
When you have great analytics on your Mailchimp email data, at times you want to also track what each individual user is doing within Google analytics for a more in-depth understanding of how each individual behaves before converting. Google has provided us with a great free tool, Google Tag Manager to simplify this without using code.
Implementation time: 15 Minutes
Prerequisites:
- Google Analytics installed on your website
- Google Tag Manager installed on your website
- Mailchimp as your email marketing service
The solution:
The solution is to use the EID (email address ID) from Mailchimp and pass it to a Custom Dimension within Google Analytics.
Step 1: Create the Custom dimension withing Google Analytics
Within google Analytics Navigate to Admin > Custom Definitions > Custom Dimensions
Create a new custom dimension called Visitor ID with the Scope set to User
Step 2: Create the trigger, variable and tags in GTM
Create the Variable:
Inside Google Tag Manager, First create a new Variable using the URL and selecting the component type Query String.
Finally we set the variable for the Query Key as mc_eid
Create the trigger:
We only want this rule to execute when the mc_eid is detected in the full URL path after someone clicks on a Mailchimp email link.
For this, create a new Trigger to fire on the Page URL when it contains the query variable mc_eid
Create the tag:
Finally we want to create the tag which pushes the mc_eid to Custom Variable 1 inside Google Analytics.
- Choose Product: Google Analytics
- Choose Tag Type: Universal Analytics
- Configure Tag:
- Tag Type: Universal Analytics
- Tracking ID: UA-XXXXXX (your GA tag)
- Tracking Type: Page View
- Custom Dimensions: If this is your first tag, then enter in the Index number as 1, followed by {{MC EID}} which is your custom variable created in the first step.
- Fire On: Some Pages > Select the trigger created in the previous step.
(Don’t forget to publish your GTM container after all the above steps have been completed)
Step 3: Set Mailchimp to use eCommerce360 Link Tracking
For every new campaign you send, ensure eCommerce360 Link Tracking is enabled. By doing this, Mailchimp will appended mc_eid=xxxxxx to every click within your emails. If you have automation running on campaigns, simply go back and update this option so future campaigns are sent with the EID of the user.
Step 4: Test out your new tag!
A quick and easy test will be to enter your website address with a random mc_eid. Alternatively you can create and send out a mailchimp campaign and click the link to ensure the mc_eid variable is being correctly passed.
Example: http://www.yourwebsite.com/?mc_eid=123456
Step 5: Check Visitor ID in Google Analytics
Within Google Analytics click on your Custimzation tab and create a new report.
Create a new report (or use an existing one) and set your Primary Drill Down dimension to the Visitor ID
It may take up to 1 hour for new visitor data to appear, but once it does you should see something like the following.