Conversion tracking onload bug




We had a problem with Twitter loading the script where it caused our onload event not to fire correctly in Safari (seems to be all Safari based browsers I could get my hands on). This caused particular problems as our Angular app waits for onload to trigger before it mounts and therefore the app simply never mounts.

This only started happening very recently (potentially within the past 12 hours or so). Has anyone else experienced this problem? Any suggestions for things to do to avoid it?

Here is the script:

<script src="//" type="text/javascript"></script>
<script type="text/javascript">twttr.conversion.trackPid('XXXX', { tw_sale_amount: 0, tw_order_quantity: 0 });</script>
<img height="1" width="1" style="display:none;" alt="" src="" />
<img height="1" width="1" style="display:none;" alt="" src="//" />

Please let us know if you’d like any more information as well. Until this issue is resolved we’re going to just use the noscript fallback.





I did some searching around and cannot find any other reports of problems in this area. Is the problem still continuing for you? Is it possible that link shortener service was simply acting up that day and not responding? Otherwise a next step might be to capture the network trace and try to figure out the exact call that it is hanging upon.




We have the same issue, since wednesday or thursday last week we’ve had an issue with the load event not firing. We’ve traced it down to oct.js. We are using gtm to load this script along with a slew of others, blocking oct.js fixes the problem.

Only manifests in Safari, tested to work in FF, Chrome and IE/Edge.


Hi @JBabichJapan,

We’re going to look at adding it to our staging Google Tag Manager to test it. It could well be that the link shortener was the part that wasn’t responding. It was very difficult to nail down actually as we had a lot going on our page (and we were fire fighting). If we can get it to hang again I can send you over a test version of the page to look at where it is still hanging.




@JBabichJapan If you add me on Twitter I will DM you the link to the place where you can test it. It’s still hanging when we add it to staging. Steps to reproduce: clear cookies, load site, go to site again going to URL again (not refresh).


Feel free to DM to @AdsAPI and let us know here when you’ve done so, so we can take a look


Thanks @jaakkosf – I have DMed @AdsAPI with details of where to view the broken site.


I’ve had the same issue since end of last week as well and just narrowed it down to both loading oct.js AND firing the page view conversion.

One way to view the symptom is that this never happens:

$(function() {
  console.log('DOM IS READY!'); // Never fires in Safari

We’re loading via GTM and have been for quite some time as well.

I just DMed details to @AdsAPI if you can check it out ASAP. Otherwise I’m going to pull it off our site in a few minutes since it’s breaking our entire site.


Hey folks, we did some investigation internally and it appeared to only repro with the following combination:

  1. Google Tag Manager
  2. Safari
  3. an onload event
  4. our Twitter pixel tag script (oct.js) firing via Google Tag Manager.

If you would be willing to test a workaround, confirming whether or not you are using Google Tag Manager and then trying to place the tag outside of that would be great to narrow down the root cause here.




Hi, I’m working with Adam Dunkley on this. In his absence I can confirm that we are adding oct.js using GTM. I have removed this tag in GTM on an instance of our website and it’s now firing the onload event in safari. @JBabichJapan please add me on twitter if you would like me to DM you the URL to the working version that doesn’t inject the script using GTM. Thanks.


Still waiting on confirmation of an official recommendation of what you folks should do but obviously for the meantime the workaround is to put it directly on the page…of course we would prefer to not have you disable conversion tracking for us so we’re still investigating with high priority.


Thanks, please provide an update when you can. Many thanks, Jordan


I can only share the blurb we are sharing with advertisers who send inquiries about this issue:

We are aware of an issue between Twitter’s Universal Website Tag and Google Tag Manager that causes JavaScript functionality attached to the onLoad event in Safari (desktop and mobile) to fail.

Our engineering team is urgently troubleshooting this issue. At this time we do not yet have an ETA for fix.

If the Twitter Universal Website Tag loaded via Google Tag Manager is causing problems with core functionality on your website, we recommend temporarily disabling the Twitter Universal Website Tag. We will let you know when the issue has been resolved and the tag can be safely re-enabled.



A fix was released for this issue - please try enabling the tags again and let us know how things go.




Thanks for your help, seems to work fine now.


Are there any technical details about what went wrong and how they were fixed that you can share for the greater good?


As far as I understand, the exact root cause is still not well understood but rolling back recent changes fixed the issue…of course our engineering team will continue to investigate and make sure any incompatibility issues do not occur for further releases.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.