Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Block s-code link tracking for dynamic telephone urls

bernadettem1
Level 1
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
joshd7227840
Correct answer by
Community Advisor
Community Advisor

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
joshd7227840
Correct answer by
Community Advisor
Community Advisor

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

bernadettem1
Level 1
Level 1

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