We've implemented YouTube embed video tracking, some embed videos are throwing us the following error.
Access to XMLHttpRequest at 'https://googleads.g.doubleclick.net/pagead/viewthroughconversion/something' (redirected from 'https://www.youtube.com/pagead/viewthroughconversion/something') from origin 'https://www.youtube.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Kindly help us to sort out this console error. Thank You.
Views
Replies
Total Likes
Check that your youtube.com URL has the "origin" parameter: https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
If it does, then I believe you can safely ignore this error. Your video tracking should still work properly.
Thank you. I can't ignore this error because tracking is not working if this error is thrown. My URL has an origin parameter. Video tracking functions work properly if the origin parameter is missing from the URL. This error is thrown and tracking is not working if the origin parameter is provided.
Is it possible to track the video using the origin parameter?
Views
Replies
Total Likes
Could you provide the YouTube URL + origin parameter that you tried but failed?
Views
Replies
Total Likes
https://demo.xerago.com/website/DigitalAnalytics/Sathya/TestPage/ This is my testing URL. I have added a YouTube URL with the origin parameter in the iframe on this site. Could you please check?
Views
Replies
Total Likes
Hmm, you're right. When the "origin" parameter is there, tracking doesn't work. When the "origin" parameter is removed, then tracking works. Yet in both cases, the error is thrown.
I suppose you can ignore the error since it doesn't affect your page nor your video.
I can't remove the "origin" parameter while still wanting to track the video events because the Business has inserted it for security reasons.
Views
Replies
Total Likes
Alright.
I wonder why your tracking fails when the "origin" parameter is present. In all of my tests and even with my client sites, I can track normally when the YouTube URL contains the "origin" parameter. So I'm not able to replicate your problem.
Thank you
Views
Replies
Total Likes
Views
Like
Replies