By default, links in the cart layout are not tracked in emails sent through Salesforce Marketing Cloud (SFMC).
Before you start
Things you need to know:
You must first contact SFMC support to enable the feature WRAP HTTPGET URLS on your SFMC account.
Enable link tracking
To enable cart layout link tracking for SFMC emails once the necessary feature is enabled in SFMC:
Take the code to merge the cart layout into SFMC, available on the cart layout preview page. It looks something like this:
`%%[Set @url = Concat('https://d1y9qtn9cuc3xw.cloudfront.net/example/content/email/?k=example&f=cart_html&e=',URLEncode([email],1))]`
`%% %%=HTTPGet(@url)=%%`You may need to change the name of the email field to match your setup.
โModify the code to add the lines in bold below:
`%%[set @url = Concat('https://d1y9qtn9cuc3xw.cloudfront.net/example/content/email/?k=example&f=cart_html&e=',URLEncode([email],1))]%%`
`%%[set @content=HTTPGet(@url)=]%%`
`%%[set @content=Replace(@content,'href="http','href="httpgetwrap|http')]%%`
`%%=TreatAsContent(@content)=%%`Add the modified code to your email template in SFMC, replacing any previously added cart code.
Finally, send a test email to confirm the cart layout links are now tracked.
You can learn more in the Salesforce documentation here.
If you need any further assistance, contact Support.