Loading Adobe Analytics no longer fires the javascript onload event. | Community
Skip to main content
May 31, 2023
Solved

Loading Adobe Analytics no longer fires the javascript onload event.

  • May 31, 2023
  • 1 reply
  • 2948 views

Loading Adobe Analytics no longer fires the javascript onload event.
Since it was running at the stage of 2023/5/22,

"buildInfo": {
"buildDate": "2023-05-25T02:19:39Z",
"turbineBuildDate": "2023-02-22T20:37:26Z",
"turbineVersion": "27.5.0"
},
It seems that the version of the script is causing a problem, what should I do?

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

When you say "javascript onload event" are you talking about the standard Window Loaded event that is an available trigger, or a custom code trigger using JS?

 

I am also running 27.5.0 and all my tracking is working fine... maybe there is a script error in your build that is breaking tracking (as opposed to the Adobe version causing issues)... That version has been in production since Feb... if there was a critical error with that version, more users would be complaining.

 

Even you said that your code was working up to 2023/5/22, since that should have been using this version of Adobe, it would indicate that it's something in your code that has broken...

 

Since I don't know what you changed, I can't really help.. but my advice would be to compare your current build to the last working build and look at what has changed... then try to figure out what broke and fix it.

 

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
May 31, 2023

When you say "javascript onload event" are you talking about the standard Window Loaded event that is an available trigger, or a custom code trigger using JS?

 

I am also running 27.5.0 and all my tracking is working fine... maybe there is a script error in your build that is breaking tracking (as opposed to the Adobe version causing issues)... That version has been in production since Feb... if there was a critical error with that version, more users would be complaining.

 

Even you said that your code was working up to 2023/5/22, since that should have been using this version of Adobe, it would indicate that it's something in your code that has broken...

 

Since I don't know what you changed, I can't really help.. but my advice would be to compare your current build to the last working build and look at what has changed... then try to figure out what broke and fix it.

 

June 5, 2023

Thank you for your reply.


I understand the situation, and it seems to be a phenomenon that occurs in Safari on iOS.


I made a simple mock to make the situation easier to understand.
This mock is as simple as javascript window.onload and window.addEventListener 'load'.

I prepared two, but the difference is whether or not the Adobe Analytics CDN is loaded.

No Adobe Analytics
https://codepen.io/mhchigpj-the-looper/pen/vYQBmeY

With Adobe Analytics
https://codepen.io/mhchigpj-the-looper/pen/YzRKVEz

Please check with Safari on iOS.


If you do not load Adobe Analytics, the onload event will run,
The onload event will not run if you are loading Adobe Analytics.

So, it is possible that Adobe Analytics is doing something wrong, such as stealing events.

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 5, 2023

Unfortunately, those samples aren't working, the Adobe Launch file is being blocked by cross-origin frame issue...

 

But, if you are trying to run multiple actual "window.onload" functions, that is bad JS practice to begin with... even without Adobe Launch, running multiple instances of "window.onload" will result in the last run variation overwriting the ones that came before.... 

 

Which is why I asked how you are handling the code in Adobe Launch? Are you using the built in trigger:



Or are you trying to run "window.onload" through a custom code block....

 

If you are trying to do a custom code block using window.onload... don't. It's not Adobe causing the problem, it's trying to run the same JS command twice in the execution that is causing the issue.

 

I've never seen Adobe's default "Window Loaded" call interfere with site code (since it should be using a listener and not superseding the JS event), but custom code when using code that should only be triggered once WILL break something.