2

We use the "mc-deep-link" tag in our href to ensure we are either pushing our customer into our App environment or to our website if the app doesn't support that specific link. All our links are dynamically populated and come with a pre-determined flag that identifies if the link is app-supported.

Opens in our app

<a href='https://www.google.com' mc-deep-link='true'>LINK</a>

Opens in browser

<a href='https://www.google.com' mc-deep-link='false'>LINK</a>

As you can see, the only difference is that the mc-deep-link tag is either set to 'true' or 'false' depending on if the link is supported by the app. Because we have a variable that will identify pre-determined app-supported links, we would love to do something link this:

<a href='https://www.google.com' mc-deep-link='%%=v(@TrueFalseFlag)=%%'>LINK</a>

I have tried multiple iterations: simply setting the flag to either true/false, setting the flag as the full string (mc-deep-link='true' or mc-deep-link='false') and just calling the variable within the href, defaulting a 'false' to either be empty or removes the mc-deep-link tag altogether, and enveloping everything into a TreatAsContent. All that to say that I am unable to force a 'false' flag dynamically to make my links go to the browser instead of the app--whenever trying to populate this flag dynamically, it always seems to default to a 'true'.

Does anyone have an idea on how we could make this truly dynamic?

3 Answers 3

1

I figured out how to dynamically disable/enable deep linking. The other methods did not work, but this one worked.

I noticed that if you hardcode the mc-deep-link attribute, this disabled the deep linking as expected as per the documentation (https://help.salesforce.com/articleView?id=mc_es_exclude_ios_universal_link.htm&type=5). Having both versions of the anchor tag and dynamically displaying which anchor to render allowed me to control which links get deep linked.

%%[
SET @deeplink = 'false'
]%%

%%[ IF @deeplink == 'true' THEN ]%%
<a href="URL" mc-deep-link="true">Your Link</a>
%%[ ELSE ]%%
<a href="URL" mc-deep-link="false">Your Link</a>
%%[ ENDIF ]%%
1
  • Yep! I probably should have mentioned this is actually the method we've been using, but I find it cumbersome to have to literally write out an entire href string twice every time we have a link, so I was hoping to find a solution that wasn't this method. Thanks, though! :)
    – Brian C
    Commented Aug 7, 2020 at 18:35
1

I have tried several methods for making this dynamic. I even spoke with SFMC support, and they said it can't be done. Which is a total bummer because that means our templates require twice the amount of markup

0

It sounds like the iOS universal link tag is evaluating before the AMPscript is executed. What if you wrap the variable in a conditional statement and write the entire 'mc-deep-link’ tag?

%%[ 
If @TrueFalseFlag == “true” then
  Set @mc-deep-link = “mc-deep-link=‘true’”
Elseif @TrueFalseFlag == “false” then 
   Set @mc-deep-link = “mc-deep-link=‘false’l
Endif
]%%

Then set your URL:

<a href=“https://google.com” %%=v(@mc-deep-link)=%% >
2
  • Hey Jackson, unfortunately, this doesn't work. I actually had already tried this before posting--this is what I meant by "setting the flag as the full string (mc-deep-link='true' or mc-deep-link='false') and just calling the variable within the href". I'm starting to think this may not be something that can be truly made dynamic.
    – Brian C
    Commented Oct 23, 2019 at 20:33
  • Sorry that I couldn't help. The only other thing I can think of at the moment is TreatAsContent but it looks like you've already tried that. Commented Oct 25, 2019 at 5:02

You must log in to answer this question.

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