Automatic outbound tracking and success event upon exit link clicking produces two server calls | Community
Skip to main content
Level 2
August 26, 2022
Solved

Automatic outbound tracking and success event upon exit link clicking produces two server calls

  • August 26, 2022
  • 2 replies
  • 1246 views

I have several exit links on my site so I have enabled automatic outbound tracking. The problem I have is that I want to implement a success event for when one of these exit links is clicked. I have set up a rule in Tags to send the success event to AA when this exit link is clicked. I configured the send beacon action with the s.tl() exit link option. The problem is that there are now two (identical) server calls whenever I click on the exit link (both including my success event). If I disable the rule then there is only one server call but without my success event. I don't want to disable the automatic outbound tracking because I have many other links that I don't want to be tracking manually, it is only this one that needs to be accompanied by a success event. I would appreciate any ideas on how to solve this.

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 Jennifer_Dungan

Since you are trying to add an event to ALL exit links (I assume based on your description)

 

In your Adobe Analytics Extension, custom code, you can add this:

 

s.usePlugins = true;
function s_doPlugins(s) { 
    if (s.linkType === 'e') { // this checks if this call is an exit link call.
        s.events = "event1";
        s.linkTrackEvents = "event1";
        s.linkTrackVars = "";
    }
}
s.doPlugins = s_doPlugins;

 

This will attach "event1" to ALL exit links, as part of the default exit link tracking. You can also add correlation props and eVars (assuming the values are still set) by listing them in s.linkTrackVars if you want (however, if you cleared you variables after the page load, this may not work... I clear my vars before the page view calls, so that my variables are still available to me here.

 

s.linkTrackVars = "server,list1,prop1,eVar1";

If you don't need any variables to be added, just the event, you can leave s.linkTrackVars right out.

2 replies

Pablo_Childe
Community Advisor
Community Advisor
August 26, 2022

What if you set a direct rule rule on the specific link click and just use it to set an set variable (event number in your case). the the exit link would hopefully just add the extra event in its beacon. The only challenge is ensure set variable fires before exit link i rule fires.

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
August 26, 2022

Since you are trying to add an event to ALL exit links (I assume based on your description)

 

In your Adobe Analytics Extension, custom code, you can add this:

 

s.usePlugins = true;
function s_doPlugins(s) { 
    if (s.linkType === 'e') { // this checks if this call is an exit link call.
        s.events = "event1";
        s.linkTrackEvents = "event1";
        s.linkTrackVars = "";
    }
}
s.doPlugins = s_doPlugins;

 

This will attach "event1" to ALL exit links, as part of the default exit link tracking. You can also add correlation props and eVars (assuming the values are still set) by listing them in s.linkTrackVars if you want (however, if you cleared you variables after the page load, this may not work... I clear my vars before the page view calls, so that my variables are still available to me here.

 

s.linkTrackVars = "server,list1,prop1,eVar1";

If you don't need any variables to be added, just the event, you can leave s.linkTrackVars right out.