2

We have a dynamically generated multi-language email which will take the country and language combination of a subscriberkey and fetch the content from a data extension, everything is working fine, with the exception of adding in an alias without a concat function.

For example, I can pull a full URL with the below code:

%%=concat('<a href="',@cta_formatted,@adobeParams,'-',@alias,'" alias="',@alias,'" style="text-decoration: none;"><img src="',@image,'" alt="',@alt,'" border="0" width="480" style="height:auto;display: block;color:#ffffff;font-size: 16px;text-align: center;font-family:''Avenir'', Arial, sans serif;"></a>')=%%

However, if I try the following on a non-dynamic link

<a href="https://www.example.com" alias="%%=v(@alias)=%%" style="text-decoration: none;">

I get the following URL generated

https://example.com?cid=XXX-XXX-%7b%7b%40alias%7d%7d

I have tried the following workarounds:

  • Using a TreatAsContent function, which results in %%%3dTreatAsContent(%27%7b%7b%40alias%7d%7d%27)%3d%%%27
  • Using GTL to pull in the alias using {{@alias}} resulting in the same as above
  • Using a concat on this static url, but this is not an option due to the way our tracking and mobile app integration (Concat links deep link through to the mobile app and tracking data is added on as part of the concat, non concat links need to open in a browser and not the app)
5
  • I did round a quick check on both above and works fine for me.... If I understand your issue correctly, I assume your issue gets resolved if you use the ampscript.guide/redirectto function... if this DOES not, then please share additional details/sample error screenshot. Dec 16, 2021 at 12:51
  • Hi @VishalKumarCV this is for the alias tag, not the URL, so the redirectto function is not applicable in this case. The Alias at the end of the URL is being garbled. Thank you for looking into this
    – terrorfall
    Dec 16, 2021 at 13:07
  • Thanks this works for the below code and gives me .... 'example.com/cta_formatted.html?adobeParam1=va1-&alias' ... seems like this issue due to some unsupported value in ALIAS value! Dec 16, 2021 at 13:14
  • %%[ SET @cta_formatted = 'https://www.example.com/cta_formatted.html' SET @adobeParams = '?adobeParam1=va1' SET @alias = '&alias' SET @image = "http://placehold.it/600x400" SET @alt = 'altText' ]%% %%=concat('<a href="',@cta_formatted,@adobeParams,'-',@alias,'" alias="',@alias,'" style="text-decoration: none;"><img src="',@image,'" alt="',@alt,'" border="0" width="480" style="height:auto;display: block;color:#ffffff;font-size: 16px;text-align: center;font-family:''Avenir'', Arial, sans serif;"></a>')=%% Dec 16, 2021 at 13:14
  • Yep, you're using a concat, which I can't do due to deeplinking through to the app vs linking to the website.
    – terrorfall
    Dec 16, 2021 at 13:18

1 Answer 1

5

The issue is the Alias is being html encoded and not rendered by the OMM engine

You need to create a support ticket and request SmartUrlEncoding be enabled for the account to use ampscript in the alias tag. You can't be using the Google Analytics Tracking feature to have this enabled

4
  • Thank you, will give that a try, we're not using GA so should be all good
    – terrorfall
    Dec 16, 2021 at 13:21
  • @EazyE how long has this SmartUrlEncoding business rule been a thing? I don't have it in my list. Dec 16, 2021 at 16:39
  • @AdamSpriggs its not a business rule its an OMM configuration, it can break stuff so its currently only enabled to solve this use case with dynamic aliases
    – EazyE
    Dec 16, 2021 at 23:47
  • @EazyE thank you so much for the solution... Could you or AdamSpriggs can you please come up with an blog/Article to explain the above with an Example, which would definitely help the SFMC community... Even I felt this concept quite complex to understand whats the issue here and how and where to enable the above configuration... Thanks in Advance. Dec 17, 2021 at 4:08

You must log in to answer this question.

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