Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Adobe Launch Not Registering Events

Avatar

Level 3

Hey guys, 

 

I have an AEM site w/ the launch script installed following these guidelines https://experienceleague.adobe.com/docs/platform-learn/implement-in-websites/configure-tags/add-embe...

Unfortunately I'm facing an issue where certain events are not firing consistently across the site. For example I'll see the 'custom-url' event appear in the console after loading a page (using _satellite.setDebug(true)), but after a cache clear + refresh the event will no longer fire on load.

 

Because the behavior is inconsistent / varies on reload I'm assuming the root cause is a race condition... but I haven't had any luck in tracking down the code or setting that is responsible. I've included two screenshots -- the first showing a custom-url firing as expected, and the second showing a case where it's not firing. From investigating the adobeDataLayer object I can tell the custom-url event is being added correctly, seems like launch is just not recognizing it as it fires

 

 



custom-url-notfired.PNGcustom-url-fired.PNG

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

If that's not the issue you need to check the rules which are triggering "custom-url" event. Take a closer look at your DOM to identify any missing elements or attributes that could be causing the inconsistent behavior.



Esteban Bustamante

View solution in original post

8 Replies

Avatar

Community Advisor

Are you using your Launch script in the header section? Is this script synchronous? Or are you using the async version of it? 



Esteban Bustamante

Avatar

Level 3

Hey Esteban -- it's in the <head> & we're using the async version.

Avatar

Community Advisor

Well, that's likely the issue, if you switch to the sync version you will solve your problem (at least you can try it to make sure that is the root cause of the issue).

This is what is suggested to solve this type of issue:

“If you see things occurring out of order, it is likely that you have some timing issues to work through. Deployments requiring precise timing might need to use event listeners and the Custom Event or Direct Call event type to make their implementations more robust and consistent.

You can read more here: https://experienceleague.adobe.com/docs/experience-platform/tags/client-side/asynchronous-deployment...



Esteban Bustamante

Avatar

Level 3

Unfortunately switching to the synchronous implementation doesn't seem to solve the problem ... the events are still loading inconsistently

Avatar

Correct answer by
Community Advisor

If that's not the issue you need to check the rules which are triggering "custom-url" event. Take a closer look at your DOM to identify any missing elements or attributes that could be causing the inconsistent behavior.



Esteban Bustamante

Avatar

Level 3

For anyone following this, I believe the problem was that we actually had two separate versions of the cif installed on our site -- 2.11 and 2.12. Current theory is that the data layer extension was attaching to one or the other on initial load, but then after the other data layer is initialized that extension is detached (leading to missed events) 

Avatar

Community Advisor

Hello @user00928 - 

 

  • Consider the timing of the event firing in relation to the page load process. Are there any dependencies on certain elements or resources that may not be consistently available on every page load? Evaluate if there are any delays or race conditions that could impact the firing of the event. [Consider adding deliberate delays or throttling mechanisms to event triggers to mitigate race conditions.]
  • Check for any caching issues that could interfere with the event firing. Clear the cache thoroughly and test the event on a clean session to see if the issue persists. Consider any caching mechanisms in place at the server, browser, or CDN level that could impact event delivery.
  • Have you ruled out the possibility if this issue is not related to a specific environment only ?

Avatar

Level 3

Hey Tanika -- unfortunately after a few days of testing I haven't been able to establish any connection between cache & whether or not launch records the events correctly. It doesn't seem to be correlated as it will work / not work regardless of if I've cleared cache (browser, cdn, dispatcher). 

The issue seems to be happening across all our environments. 

 

Do you have a suggestion for implementing a general throttling method on these data layer events? Or is my best bet just to overlay the OOB adobe code and work through them one at a time