Expand my Community achievements bar.

SOLVED

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 Accepted Solution

Avatar

Correct answer by
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';

}

View solution in original post

2 Replies

Avatar

Correct answer by
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.