Script tags not served for User Agent "Mediapartners-Google"

Hi, I was using netlify with my gatsby website deployed on
When i tried to apply for Adsense, my account was rejected as the script tags are not being served for Adsense Bot with User Agent “Mediapartners-Google”. I was serving the script tag with snippet injection and there is no robots.txt file present in my repo.
Please help me to fix this.

Hi Deepinder,

Which tags are you referring to exactly? Happy to take a look but not quite understanding based on your description.

I’m hoping for something like:

  • I use snippet injection here (link to our UI dashboard where you’ve set it)
  • when I load URL X I expect to see <script ...> in the output
  • I do see it in my browser, but when google reaches my site, they don’t see it. I can simulate this in curl with this command curl -A Mediapartners-Google https://mysite which works differently than curl https://mysite as you can see in the output - the script is missing in the prior

Thanks in advance for your help in troubleshooting!