내 커뮤니티 업적 표시줄을 확대합니다.

Join Adobe Experience Platform experts for a live Ask Me Anything on September 2nd at 8 AM PT!

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Block s-code link tracking for dynamic telephone urls

Avatar

Level 1

Hi there,

My marketing team is using a third party to track phone calls on our site. This required us to write phone numbers as href:"tel:###-###-###" in our html. Is there a way to never track the telephone numbers? To my knowledge, I can't use regex in the "Never Track" UI list for Link tracking. I also tried writing jquery to s.abort on all $('a[href^="tel:"]') with no luck. 

Any suggestions would be appreciated! Thanks!

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 9

Add the "tel:" prefix to the linkInternalFilters variable in your Adobe Analytics config.

Example:

s.linkInternalFilters = "tel:,javascript:,mailto:,.yoursite.com";

If you have Adobe Analytics implemented as a Tool in DTM, then you can add it within the AA tool config, under

Link Tracking > Outbound Links > Never Track

eOEFAj8.png

The DTM config version above will also populate linkInternalFilters.

And in general, linkInternalFilters is a substring ("contains") match against the href=".." value.  So it's not the same as using regex or other code to ensure the href value starts with "tel:" but in practice, this is usually good enough, because it will match your tel: links and usually you won't have other URLs where "tel:" is part of the href value but not at the beginning.

But if you really want to ensure it is at the beginning, then within your doPlugins function, you can suppress the s.tl call with the following:

if ( s.linkObject && s.linkURL && s.linkURL.match(/^tel:/i) ) {

     s.linkType = 0;

}

Or, if you don't want to suppress the s.tl call, but want to keep the telephone number from being recorded, you can set s.linkURL to a different value:

if ( s.linkObject && s.linkURL && s.linkURL.match(/^tel:/i) ) {

     s.linkURL = 'masked value';

}

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
Level 9

Add the "tel:" prefix to the linkInternalFilters variable in your Adobe Analytics config.

Example:

s.linkInternalFilters = "tel:,javascript:,mailto:,.yoursite.com";

If you have Adobe Analytics implemented as a Tool in DTM, then you can add it within the AA tool config, under

Link Tracking > Outbound Links > Never Track

eOEFAj8.png

The DTM config version above will also populate linkInternalFilters.

And in general, linkInternalFilters is a substring ("contains") match against the href=".." value.  So it's not the same as using regex or other code to ensure the href value starts with "tel:" but in practice, this is usually good enough, because it will match your tel: links and usually you won't have other URLs where "tel:" is part of the href value but not at the beginning.

But if you really want to ensure it is at the beginning, then within your doPlugins function, you can suppress the s.tl call with the following:

if ( s.linkObject && s.linkURL && s.linkURL.match(/^tel:/i) ) {

     s.linkType = 0;

}

Or, if you don't want to suppress the s.tl call, but want to keep the telephone number from being recorded, you can set s.linkURL to a different value:

if ( s.linkObject && s.linkURL && s.linkURL.match(/^tel:/i) ) {

     s.linkURL = 'masked value';

}

Avatar

Level 1

Oh thank you! Awesome. Thanks for the timely/thorough response.