How to prevent the default download link to trigger under certain conditions? | Community
Skip to main content
Level 6
July 9, 2018
Solved

How to prevent the default download link to trigger under certain conditions?

  • July 9, 2018
  • 1 reply
  • 1846 views

We would like to keep the default download link tracking configured in the Analytics Extension's "Link Tracking" section with the default file extensions in place. But there are a few lightboxes which should not count towards a download. But as there is no specific rule for these, and the lnk_d is triggered automatically, how can I add some conditions? Can I prevent the tracking somehow in the custom doPlugins method?

And a small side question, related to this, how can i clear the variables after this automatic lnk_d tracking?

I have the following code in the doPlugins where these variables are also sent with the next custom link on the same page:

if (s.linkType === 'd') {

  s.linkTrackVars = 'events,eVar11,prop11';

  s.linkTrackEvents = 'event4';

  s.events = 'event4';

  s.eVar11 = s.linkURL.split('/').pop();

  s.prop11 = 'D=v11';

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by thomas_amsler

I found the s.abort flag which seems to do what I want.

1 reply

thomas_amslerAuthorAccepted solution
Level 6
July 9, 2018

I found the s.abort flag which seems to do what I want.