Created
February 13, 2019 16:59
-
-
Save MyCueCards/e72bfbacdc4e6d8405cf9b137a701ecf to your computer and use it in GitHub Desktop.
In Salesforce Marketing Cloud, a client is using AMPscript to pull a URL from the sending data extension (DE) into an email. The client has a Web Analytics Connector (WAC) integration, which adds parameters to the end of a URL when the email recipient opens the email. The URL generated from the WAC attempts to use a value from the sending DE, wh…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- AMPscript Block --> | |
%%[ | |
var @UTMstring1 | |
set @UTMstring1 = "?utm_source=SFMC&utm_medium=email&utm_campaign" | |
var @UTMstring2 | |
set @UTMstring2 = "&utm_content=" | |
var @UTMstring3 | |
set @UTMstring3 = "&utm_subscriber=" | |
var @url1 | |
set @url1 = ProductUrl1 | |
var @link1 | |
set @link1 = Concat('href="',@url1,@UTMstring1,emailname_,@UTMstring2,@url1,@UTMstring3,subscriberid,'"') | |
set @link1 = URLEncode(@link1) | |
]%% | |
<!-- snippets within HTML --> | |
This is the URL: <a %%=v(@link1)=%% target="_blank">%%ProductUrl1%%</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I recall, SFMC may not track the clicks, since the click.domain.com wrapper no longer exists. That may be what you're describing. When this was written, it was just to get the URL parameters from a webpage to GA. If you have a setup where email clicks are being tracked by SFMC and then fed into GA, then this code won't work.