Search code examples
adobe-analytics

Adobe Analytics event firing on every page


I'm using DTM to implement Adobe Analytics code on a single page app.

I have a link that we've set up successfully as an exit link and it fires as it should. If this matters, it opens in a new tab and we don't actually exit the website. However, any time we fire off any subsequent page views, we see the same event fired. Is there any way to fire off this event only when the link actually is clicked? I assume that because it's a one page app and the code isn't getting refreshed that is the reason it's on every subsequent page.


Solution

  • Please check witch version of s_code you are using, if you are using Appmeasurement or one of the last s_code versions please use clearkVars() function. following code is a log from browser console with console responses:

    s.events ="event1"
    "event1"
    s.linkTrackVars='events';
    "events"
    s.eVar1="value"
    "value"
    s.clearVars();
    undefined
    s.events
    undefined
    s.eVar1
    undefined
    

    you can fire this in custom code section (if your custom code section is set to fire after gui settings, or you can fire it as JavaScript 3rd party tag.