2

I have a CMS built with angular that allows users to create a basic website and then register an available domain to use. For example, if I register example.com, when a user goes to example.com, it pulls data down and renders content for that site. example2.com can also be created and if that is accessed, it pulls content for that site.

The problem I have is when signing up for Google analytics, it asks for a website URL, but in my case it varies, so can I use an IP address? or is there another option as well?

3
  • "it varies" as in there are multiple domains? I'd say just pick one of them. – Stephen Ostermiller Jun 14 '17 at 16:53
  • @StephenOstermiller - They are different websites. I want to know who came went to example.com as opposed to example2.com – xaisoft Jun 14 '17 at 17:37
  • Then create a setting in the CMS for each domain allowing the user to input their Google Analytics tracking id or snippet and treat each domain separately. – Stephen Ostermiller Jun 14 '17 at 17:39
2

Unless you want to limit your tracking code to just one domain it should be fine to use it in a different domain. Just make sure you use auto as a parameter:

ga('create', 'UA-XXXXX-Y', 'auto');

Specifying auto enables automatic cookie domain configuration, which tells analytics.js to automatically determine the best cookie domain to use.

Reference

1
  • OK Thanks, When I signed up, I put the IP address for the Website URL (will it use this for anything?). I did notice the script has auto in it already. – xaisoft Jun 14 '17 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.