1

With the help of Eliot Harper and Hans Meijer I started to develop a newsletter that contains salesforce marketing cloud web recommendations. However I don't know how it is possible to create a picture with a href that has tracking functionality inside the newsletter and tracking functionality of the recommendation system.

  • The variable @link2 contains the web recommendation url that points to the https://nova.collect.igodigital.com/redirect/...
  • The variable @image2 contains the imageurl of the product catalog of salesforce.
  • The variable @linkwithhref2 contains the complete href set @linkwithhref2=Concat('href="',@link2,'"')

I tried these options:

Option 1:

<a alias="" conversion="false" data-linkto="https://" href="%%=v(@link2)=%%" style="text-decoration:none;" title=""><img src="%%=v(@Image2)=%%" style="padding: 0px; height: 250px; width: 250px; border-width: 0px; border-color: transparent; border-style: solid; text-align: center;" width="250"></a>

Result 1:


Option 2:

<a alias="" conversion="false" data-linkto="https://" href="%%=TreatAsContent(@link2)=%%" style="text-decoration:none;" title=""><img src="%%=v(@Image2)=%%" style="padding: 0px; height: 250px; width: 250px; border-width: 0px; border-color: transparent; border-style: solid; text-align: center;" width="250"></a>

Result 2:


Option 3:

<a alias="" conversion="false" data-linkto="https://" %%=TreatAsContent(@linkwithhref2)=%% style="text-decoration:none;" title=""><img src="%%=v(@Image2)=%%" style="padding: 0px; height: 250px; width: 250px; border-width: 0px; border-color: transparent; border-style: solid; text-align: center;" width="250"></a>


How can i combine both functionalities (click tracking inside the newsletter and click tracking of recommendations). Any comments or hints welcome :)

1 Answer 1

3

Try using the RedirectTo() function. Something like:

<a conversion="false" data-linkto="https://" href="%%=RedirectTo(@link2)=%%" style="text-decoration:none;" title=""><img src="%%=v(@Image2)=%%" style="padding: 0px; height: 250px; width: 250px; border-width: 0px; border-color: transparent; border-style: solid; text-align: center;" width="250"></a>

This function is designed to handle all AMPscript variables used as links to ensure they are correctly wrapped for tracking.

ALSO, I have run into cases where with WAC turned on, if you do not have an alias, then it will break the link. So try adding in something like:

<a conversion="false" data-linkto="https://" href="%%=RedirectTo(@link2)=%%" style="text-decoration:none;" title="" alias="Image2"><img src="%%=v(@Image2)=%%" style="padding: 0px; height: 250px; width: 250px; border-width: 0px; border-color: transparent; border-style: solid; text-align: center;" width="250"></a>

4
  • 1
    Great answer. I should have also known that but sometimes you just forget some functions :D Can you tell me what WAC means? Its no typical abbreviation I know, googling it gives me answers that do not fit, one of these: acronyms.thefreedictionary.com/WAC ? I believe its "works as coded" but i am unsure. One stuff you could change: correct the code in your answer that it doesnt contain two aliases Commented Feb 5, 2019 at 16:04
  • Web Analytics Collector for SFMC Commented Feb 5, 2019 at 16:52
  • Is there a best practice what you should insert in the alias? Is it a productname like "2345" or a region like "link3". Where does this pop up and does title will be shown when you insert a text? Commented Feb 6, 2019 at 8:48
  • 1
    Aliases have to be static text, not variables. They show as aliases for links in tracking in Email Studio, in the _Click data view and in the Click tracking extracts. Commented Feb 6, 2019 at 12:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .