Question

using google analytics for an app

im trying to get analytics from a digitalocean app. i copy/pasted the code google gives me in my index.html page but i have this error : Cookie “_ga_myID” has been rejected for invalid domain. Cookie “_ga” has been rejected for invalid domain. the domain is like this : https://myapp-xxxxx.ondigitalocean.app/


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

I would suggest adding your own custom domain name rather than the one automatically generated by the App Platform.

You can follow the steps on how to do that here:

https://docs.digitalocean.com/products/app-platform/how-to/manage-domains/

That way you will have full control over the domain name and would be able to verify it in your Google Analytics account.

If you do not have a domain name already, you can follow the steps here on how to get a free one:

Regards,

Bobby

Hi @,

I’m not sure what your APP is about but check this tutorial it says how you can add Google Analytics to a DigialOcean APP

https://www.digitalocean.com/community/tutorials/react-redux-beacon

Additionally, you can check this tutorial here, I think it will be quite useful for you:

https://www.digitalocean.com/community/tutorials/how-to-deploy-your-own-web-analytics-software-with-umami-on-digitalocean-s-app-platform