Rule is fired but beacon isn't sent | Community
Skip to main content
Level 4
July 10, 2023
Solved

Rule is fired but beacon isn't sent

  • July 10, 2023
  • 1 reply
  • 3528 views

Hi Community,

 

For a specific page template on my website, I have 2 rules sending beacon (s.t()).

The first rule is the generic one (rule name : "BOTTOM") which sends a pageview event on every page of my website.

 

I'm struggling with my second rule dedicated to this specific page template (rule name : "Product-dt").

It's a basic rule as it's waiting "Page BOTTOM" event with a condition on a specific page template of my website.

I added 2 actions : Adobe Analytics - Set Variables wait, then Adobe Analytics - Send Beacon (s.t())

 

The problem is that when I'm testing my rule, I can see only one beacon fired (I assume it's the one coming from my BOTTOM generic rule) :

My rule product-dt is fired but it seems that it doesn't send a beacon.

 

Has anyone come across a similar case?

Thanks

 

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

Yes it's part of my product-dt rule.

 

I juste made the change and tested it, but it doesn't seem to help... 

I am seeing beacon fired in my JS Console, but when I want to check in Adobe Platform Debugger, it's like nothing happened...

 

 

 


Ok, let's try the "heavy handed" approach...

 

Remove the Send Beacon action completely

 

Go into your Set Variables action, open Custom Code (if you have any custom code here, you need to add this to the end), and add:

 

s.t();

 

Basically, we are trying to ensure that everything in your Set Variables is finished before the beacon is set.. if this works, I suggest renaming you action to something like "Adobe Analytics - Set Variables and Send Beacon" so that you remember why you don't have a "Send Beacon" in the rule...

 

I had to do this on some of my implementations due to timing issues.

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 10, 2023

No, generally the issue is trying to prevent multiple s.t calls from being made for the same page... but given your description, you are expecting to track the same page twice?

 

This is bad... you don't want to artificially inflate your Page Views by tracking the same page twice.

 

If the rule "fires" then unless you have a JS error happening in your rule, the full rule will run. So if you aren't seeing the beacon, I assume that your rule triggers (which is why the debug shows it) then something is failing inside it resulting in not getting the beacon...

 

But again, I cannot stress enough how bad for your overall analytic health firing two s.tl calls is....

Swanan_Author
Level 4
July 11, 2023

Hi Jennifer, 

 

Thank you for your help on subject ! 

Well no I'm not expecting to track 2 pageviews... I didn't think about that before asking the community lol.

Indeed this is a bad practice and that's not what I want, for sure !

 

So I should prevent my rule "BOTTOM" from triggering on my page and only have my rule "product-dt  to be triggered and that should solve my issue ? 

 

Thank's again for your help !

 

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 11, 2023

If you have 2 rules set to trigger on "BOTTOM", then they will both need conditions...

 

One for condition IS product-dt

The on the main one IS NOT product-dt

 

Or, build some logic into your one rule in the that will make the minor change to accommodate product-dt all within the single rule...

 

If you are using standard prop and eVar set up with Data Elements, then you can use a custom code Data Element that does the product-dt detection... if product-dt then set and return a value, if not, then return "". If you are trying to trigger a custom event, you can add this in your custom code area of your rule:

 

// Add your proper product-dt detection to the if statement if (product-dt){ s.events = s.events ? s.events + ",eventX" : "eventX"; // short form notation... if there is a value in s.events, add ",eventX" to the end of s.events; if nothing in events, you don't need the comma, so just set the value to "eventX" - change eventX to the proper event }

 

 

It really depends on your complexity and needs, but for minor differences, I always combine them into one main tracking rule (cause if I have to add a new global dimension, the less rules I have to update the less time and testing that needs to be done.