GA4 video tracking IE enablejsapi=”true” parameter
-
enablejsapi=”true”
Is there a way to pass this parameter in the shortcode? Or where could I edit the plugin code to insert this for every embed?
This code is needed for Google Analytics’ GA4 to automatically track YouTube videos (as event).
Thanks.
—————
Some relevant information:`Video tracking in enhanced measurement works for embedded Youtube videos that have the JavaScript API enabled. That can be done by adding the enablejsapi=”true” attribute to the iframe, for example:
<iframe src=”https://www.youtube.com/embed/QfUSKYJz5QE” width=”560″ height=”315″ title=”YouTube video player” enablejsapi=”true” frameborder=”0″ allow=”accelerometer; clipboard-write; encrypted-media; picture-in-picture” allowfullscreen></iframe>
Or by decorating iframe’s src with “enablejsapi=1”, for example:OR
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/QfUSKYJz5QE?enablejsapi=1″ title=”YouTube video player” frameborder=”0″ allow=”accelerometer; clipboard-write; encrypted-media; picture-in-picture” allowfullscreen></iframe>
- The topic ‘GA4 video tracking IE enablejsapi=”true” parameter’ is closed to new replies.