【问题标题】:Why won't my SalesForce Marketing Cloud url that uses an anchor link will not go to the anchored spot on the website page为什么我的使用锚链接的 SalesForce Marketing Cloud url 不会转到网站页面上的锚点
【发布时间】:2021-04-22 18:44:00
【问题描述】:

所以我们有一个从查找数据扩展(数据表)中动态提取的 url。它的结构如下:https://www.clientsite.com/on-boarding/#anchorlocation。但是,当我们测试发送电子邮件并单击链接时,我们会转到页面,但锚不会将您带到链接的锚位置。调查后发现,一旦我们从 url 末尾删除跟踪参数,它就可以正常工作,因为它是原始 url。但是,我们需要跟踪,因此删除跟踪不是一种选择。那么,问题是什么?下面是代码示例:

<table width="100%" cellspacing="0" cellpadding="0" border="0">
   <tr>
      <td valign="middle" align="center">
        <a alias="%%=v(@Alias)=%%" href="%%=RedirectTo(@URL)=%%" target="_blank"><img alt="" border="0" src="%%=v(@VideoImage)=%%" style="display:block;" title="" width="100%" /></a></td> 
   </tr>
</table>

这是发送电子邮件后的 URL 示例。此链接将转到页面,但不会转到页面的锚定部分:

https://www.clientsite.com/on-boarding/#anchorlocation?utm_source=Onboarding&utm_medium=email&utm_term=Card%20Ship&utm_content=AliasName&utm_campaign=Onboarding_Card_Ship

【问题讨论】:

    标签: email salesforce salesforce-marketing-cloud ampscript


    【解决方案1】:

    所以,经过一段时间后,我确实发现了发生了什么以及如何解决它。看来锚名称必须在 url 的末尾。所以它应该是这样的:

    https://www.clientsite.com/on-boarding/?utm_source=Onboarding&utm_medium=email&utm_term=Card%20Ship&utm_content=AliasName&utm_campaign=Onboarding_Card_Ship#anchorlocation

    以下是我使用动态内容实现这一目标的方法。我知道跟踪参数是什么以及数据来自哪里来填充它们。所以我只需要使用 Ampscript Concat 函数来重新排列 url。这是该代码的示例:

    %%[
    /* This is pulled from the DE or Data Table */
    Set @URL = '#anchorlocation' 
    
    /* This resets the variable to the rearranged url */
    Set @URL = Concat('https://www.clientsite.com/on-boarding/?utm_source=',__AdditionalEmailAttribute1,'&utm_medium=email&utm_term=',__AdditionalEmailAttribute2,'&utm_content=Alias&utm_campaign=',emailname_,@URL) ]%%
    

    然后,当我在代码中调用变量时,我需要连接锚点和图像标签的 html,以便不会再次对其进行跟踪。该代码如下所示:

    %%=concat('<a alias="',@Alias,'" href="',@URL,'" target="_blank"><img alt="" border="0" src="',@Image,'" style="display:block;" title="" width="100%" /></a>')=%%
    

    将它们放在一起,整个代码如下所示:

    %%[ Set @URL = Concat('https://www.clientsite.com/on-boarding/?utm_source=',__AdditionalEmailAttribute1,'&utm_medium=email&utm_term=',__AdditionalEmailAttribute2,'&utm_content=Video_Alias&utm_campaign=',emailname_,@URL) ]%%<table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#E8E8E8">
       <tr>
          <td style="line-height:1px; font-size:1px;" height="1" bgcolor="#DEDEDE">&nbsp;</td>
       </tr>
       <tr>
          <td valign="top" bgcolor="#E8E8E8" align="left">
             <table width="100%" cellspacing="0" cellpadding="0" border="0">
                <tr>
                   <td valign="middle" align="center">%%=concat('<a alias="',@Alias,'" href="',@URL,'" target="_blank"><img alt="" border="0" src="',@Image,'" style="display:block;" title="" width="100%" /></a>')=%%</td>
                </tr>
             </table>
          </td>
       </tr>
       <tr>
          <td style="line-height:1px; font-size:1px;" height="1" bgcolor="#DEDEDE">&nbsp;</td>
       </tr>
    </table>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      • 1970-01-01
      • 1970-01-01
      • 2014-08-08
      • 2013-09-08
      • 1970-01-01
      相关资源
      最近更新 更多