Expand my Community achievements bar.

Applications for the Community Advisor Program Class of 2025 are NOW OPEN – Apply Today!
SOLVED

Link Tracking working for some buttons but not all buttons

Avatar

Level 1

I've been experiencing a problem with our link tracking where certain button clicks don't send a click event to Adobe Analytics. I didn't setup the tracking, but from what I can tell, the configuration is looking for any buttons with CSS selector "button". We have a custom condition as well to ignore buttons with PII as we are not allowed to track users personal information. I've verified that buttons that aren't being sent do not meet the conditions to be excluded. Currently at a loss for how to solve this issue as it is affecting multiple of our button click tracking capabilities.

This is what the setup looks like:

Link tracking setup:

jonathancastillo_1-1740148237453.png

Activate Link Tracking is custom code:

jonathancastillo_2-1740148273318.png

 

 

Custom code for excluding user data (in the NOT condition):

jonathancastillo_0-1740148199297.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

Have you enabled Satellite Debugging to see if the rule is triggering or not? And are you seeing any JS errors?

 

First, in you console enable the debugging:

_satellite.setDebug(true);    // Turn Debugger On

_satellite.setDebug(false);    // Turn Debugger Off

 

Also, make sure that your console is set to "Preserve Log" (so that as the buttons navigate you to other pages, you can see what happened before the navigation.

 

 

When you are testing your button, you should see something like:

Rule "Global Link Tracking" fired.

(If the rule passed all the conditions and was triggered)

 

Or

 

Condition "Core - Custom Code" for rule "Global Link Tracking" was not met.

(if the rule didn't meet your conditions)

 

 

If you don't see anything for the rule at all, then the trigger isn't being met for some reason.

 

 

If the rule is firing, and still isn't tracking, then something in the custom code isn't working. I'm not quite sure what that code is doing, and why you aren't just setting the variables and sending the beacon on this rule... It's also possible that the code, due to having to go though multiple steps is just getting cancelled as the user is navigated away from the page (i.e. all the steps needed to trigger tracking haven't completed by the time the page is no longer available)

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

Have you enabled Satellite Debugging to see if the rule is triggering or not? And are you seeing any JS errors?

 

First, in you console enable the debugging:

_satellite.setDebug(true);    // Turn Debugger On

_satellite.setDebug(false);    // Turn Debugger Off

 

Also, make sure that your console is set to "Preserve Log" (so that as the buttons navigate you to other pages, you can see what happened before the navigation.

 

 

When you are testing your button, you should see something like:

Rule "Global Link Tracking" fired.

(If the rule passed all the conditions and was triggered)

 

Or

 

Condition "Core - Custom Code" for rule "Global Link Tracking" was not met.

(if the rule didn't meet your conditions)

 

 

If you don't see anything for the rule at all, then the trigger isn't being met for some reason.

 

 

If the rule is firing, and still isn't tracking, then something in the custom code isn't working. I'm not quite sure what that code is doing, and why you aren't just setting the variables and sending the beacon on this rule... It's also possible that the code, due to having to go though multiple steps is just getting cancelled as the user is navigated away from the page (i.e. all the steps needed to trigger tracking haven't completed by the time the page is no longer available)

Avatar

Level 9

Hi @jonathancastillo ,

I agree with @Jennifer_Dungan , you need to use elimination process to get to the root cause, follow these steps,

  • Enable satellite debugging and check for "rule fired" or "condition not met" messages,
    • If you get any of these, it means your rule trigger/event is working and condition was met as well
    • If you don't see any of these, there is an issue with your rule trigger/event
    • If you get "condition not met" message, there is an issue with rule condition
  • If rule is triggering fine, there is an issue with rule action. Add checkpoints to your window.constructClickEventParams() function to identify at what point the logic of this function is breaking

Eliminating the rule components one by one and using checkpoints will help you narrow down the root cause which you can then fix to resolve the issue.

Cheers!

Avatar

Level 2

@jonathancastillo  can you try to run this and check if the button click is actually working or not 

document.querySelector("button").addEventListener("click", () => console.log("Button Clicked!"));

And if this is working then go with the solution mention by @Jennifer_Dungan