简体   繁体   中英

Multi-tenant support with Google Analytics / Piwik + MVC?

Is there any way to configure google analytics or Piwik to work with any domain / subdomain? I have a multi-tenant app that is accessed via URLs like the following:

tenant1.app.com
tenant99.app.com
appname1.com - points to tenant1.app1.com
appname2.com

so coding each tenant isn't an option, as they are constantly being added / changed. Ideally, we could just slap a <script> in the _Layout page of our MVC application and get reporting on each URL that's accessed, without specifying the url in the script. Is this possible with GA, or any free analytics tool?

Piwik will work out of the box with any number of different domains/subdomains. Simply fetch the tracking code from Settings > Websites into your _Layout and it will automatically track your pages regardless of the URL used.

Note that it is recommended for each website that you setup in Piwik to add the hosts that the website is available at, but that isn't required.

Definitely possible in Analytics as well. This article should be helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM