YouTube embed video tracking - console error | Community
Skip to main content
Sathya_Murugaiyan
Level 2
December 8, 2022
Question

YouTube embed video tracking - console error

  • December 8, 2022
  • 1 reply
  • 2854 views

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.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

yuhuisg
Community Advisor
Community Advisor
December 9, 2022

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.

Sathya_Murugaiyan
Level 2
December 9, 2022

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?

yuhuisg
Community Advisor
Community Advisor
December 9, 2022

Could you provide the YouTube URL + origin parameter that you tried but failed?