
Updating GA Tracking Parameters
We've got a Google tracking implemented on our parent business unit and want to add "utm_content" however am not sure of the correct syntax to apply to dynamically pull in the click through alias name as we've done with campaign name.
Here is our code today:
%%[
SET @source="sfmc"
SET @medium="email"
SET @campaign=UrlEncode(Concat(__AdditionalEmailAttribute1,":",listid),1,1)
SET @user=SHA256(emailaddr)
SET @wttsrc="email"
SET @wtmcid=UrlEncode(Concat("Email","|",__AdditionalEmailAttribute1,"|",listid),1,1)
SET @string=Concat("utm_source=",@source,"&utm_medium=",@medium, "&utm_content=",@content,"&utm_campaign=",@campaign,"&user_id=",@user,"&WT.tsrc=",@wttsrc,"&WT.mc_id=",@wtmcid) ]%%%%=v(@string)=%%
And here is what this should look like:
%%[
SET @source="sfmc"
SET @medium="email"
SET @campaign=UrlEncode(Concat(__AdditionalEmailAttribute1,":",listid),1,1)
SET @content="INSERT_VALUE_HERE"
SET @user=SHA256(emailaddr)
SET @wttsrc="email"
SET @wtmcid=UrlEncode(Concat("Email","|",__AdditionalEmailAttribute1,"|",listid),1,1)
SET @string=Concat("utm_source=",@source,"&utm_medium=",@medium, "&utm_content=",@content,"&utm_campaign=",@campaign,"&user_id=",@user,"&WT.tsrc=",@wttsrc,"&WT.mc_id=",@wtmcid) ]%%%%=v(@string)=%%
What is the correct syntax thats needed to replace 'INSERT_VALUE_HERE' to pull in our click name aliases automatically as we've done with campaign?
I think you're implementing it completely incorrectly, so this is what I would do (you won't be able to track link alias or URL that way):
1. Concat support and ask them to use this as the web connector string:
utm_source=%%=v(@source)=%%&utm_medium=%%=v(@medium)=%%&utm_content=%%linkname%%&utm_campaign=%%=v(@campaign)=%%&user_id=%%=v(@user)=%%&WT.tsrc=%%=v(@wttsrc)=%%&WT.mc_id=%%=v(@wtmcid)=%%
2. In your emails, use:
%%[
SET @source="sfmc"
SET @medium="email"
SET @campaign=UrlEncode(Concat(__AdditionalEmailAttribute1,":",listid),1,1)
SET @user=SHA256(emailaddr)
SET @wttsrc="email"
SET @wtmcid=UrlEncode(Concat("Email","|",__AdditionalEmailAttribute1,"|",listid),1,1)
]%%
That sets all the values for each variable except @content since that will populate with either the URL or the link alias of the link clicked.
When doing a "tracking enabled" send (track all links) will automatically populate every link in your emails.