Nebula icon indicating copy to clipboard operation
Nebula copied to clipboard

GA4 Enhanced Measurement is conflicting with Nebula's Youtube API

Open chrisblakley opened this issue 1 year ago • 0 comments

GA4 has "Enhanced Measurement" which automatically tracks Youtube videos which is handy, however, Nebula's video tracking has more features and at the very least during the transition would be useful to cross-reference, so I don't want to simply delete it.

Also, Nebula will add the ?enabledjsapi=1 parameter to videos that need it whereas GA4 will just ignore those videos.

Example page: https://nebula.gearside.com/functions/video_meta/

Now, when a page is loaded with Youtube iframes, GA4 will trigger first and initiate the Iframe API. Nebula has been updated to adapt for this and it can piggyback off of that. However, GA4 creates the player instances and that prevents Nebula from tracking those videos– it's individual onReady functions never trigger.

This event never triggers because GA4 hijacks it with its own player:

Screen Shot 2022-11-01 at 12 53 08 PM

It does not appear that multiple players can exist for a single video.

Another unfortunate side-effect of this is that only GA4 properties get the GA4 data– whereas Nebula sends the data to both GA4 and UA properties simultaneously.

So currently as it stands GA4 tracks initial and lazy-loaded videos (and no data in UA), and Nebula is left to only track those videos that do not have the ?enablejsapi=1 parameter (in both GA4 and UA).

The only other option would be to deactivate the enhanced measurement for video tracking...

Related: #2076

chrisblakley avatar Nov 01 '22 16:11 chrisblakley