Block s-code link tracking for dynamic telephone urls

Avatar

Avatar
Validate 1
Level 1
bernadettem1
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bernadettem1
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
bernadettem1
Level 1

30-11-2017

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!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

30-11-2017

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';

}

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
bernadettem1
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bernadettem1
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
bernadettem1
Level 1

30-11-2017

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