Expand my Community achievements bar.

Join us at Adobe Summit 2024 for the Coffee Break Q&A Live series, a unique opportunity to network with and learn from expert users, the Adobe product team, and Adobe partners in a small group, 30 minute AMA conversations.
SOLVED

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

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

2 Replies

Avatar

Community Advisor

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.

Avatar

Correct answer by
Community Advisor

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.