Wordpress Multisite & Google Analytics - wordpress

I have a WordPress Multisite network with many sub-sites under the same domain (site.com/sub1 / sub2 etc) and I want to start using Google Analytics to track each sub-site separately.
I read that it's possible to do it manually by using tags on the dashboard, but the issue is that the sub-sites are created automatically so I need to find an automatic solution from Google Analytics side..
I tried to check the Google Analytics's API but didn't find a right solution.
I would appreciate your help and suggestions for how to do it!
Thank you!

Related

How to link Google Analytics account to wordpress

I have read multiple tutorials on web but I'm unable to find my tracking I'd/code on my Google Analytics property list. This is the image which I got from web and I want to see m Any help will be appreciated.
You can simply use any plugin out there. Here are some of my favorites:
Google Site Kit. <== This is the official Google Plugin
MonsterInsights
ExactMetrics
GA Google Analytics <== Simplest and just for this purpose. No unnecessary code.
Note: There are many others but these are per my favorites list and liking.
1st plugin will auto-connect with your google account and you won't need to put any ID or code into your site manually. Hence easy to set up.
Site Kit by Google is great for WordPress users. By using Site Kit you don't need to manually insert the code, as depicted by the screenshot you share. The plugin can insert the code for you.
In addition to the placement of code, Site Kit can show you Analaytics and other data within your wp-admin dashboard!

What to do with Google Analytics for domain and subdomain which will be moved to subdirectory?

I have a Wordpress site (example.com) and subdomain (sub.example.com). They have separate Wordpress dashboards and work like 2 separate websites. 2 different Google Analitycs Tracking IDs set up for them, so we have 2 different Google Analytics accounts and 2 different properties respectively. Now we redesigned both websites and want to move subdomain to a subdirectory, so it will look like this: sub.example.com --> example.com/sub, but they still have 2 separate Wordpress dashboards.
My question is, what should I do with Google Analytics? Should I put the domain GA tracking code on subdirectory website as well? As the initial idea behind making moving subdomain to subdirectory was for SEO boost and consolidation of traffic.
I also would like to start using Google Tag Manager to implement GA tag.
Would appreciate some input on this as I'm really confused Thanks!
You have to use 'google analytics' separately for both the websites as header is different in both the websites.

How to implement google analytics on vue app on multiple domains?

I have multiple domains that use the same files (from git master branch). Now, I want to implement google analytics on each domain.
I've tried this vue-anlaytics package multiple domain tracking (see link - https://medium.com/dailyjs/tips-tricks-for-vue-analytics-87a9d2838915#7ead) but the problem is whenever I try to visit domain1.com. It also registers on the domain2.com google analytics dashboard.
Please help.
Defining the tracking code or GA_ID to an environment variable on each instance helped me solve the issue.

Link Wordpress website to a different Google Analytics Account

I am maintaining a Wordpress website, and use Google Analytics to track visits.
The problem is that to do this I have linked the site with my personal Google account. Now I am going to hand over to a new webmaster. I don't want to hand over the details of my Google account, so it will have to be set up with a different Google account. I can find previous answers that tell me how to set up Google Analytics with Wordpress from scratch, but not to change to a different account.
Can anyone suggest what might be the best way forward?

Tracking a subdomain separately in Google Analytics

So I've been trying to set up Google Analytics to track site's (Tumblr) blog separately from the rest of the site, but I've been having no luck. All of the tutorials online seem to be outdated, and Google's own help center isn't helping.
Can someone please help. I tried messing with filters, but simply can't get it to work.
The website is sitename.com and the blog is blog.sitename.com. They both share a tracking code.
Thanks!
Create an a custom include filter on the hostname:
on one profile, include only ^www.domain.com$
on another profile, include only ^blog.domain.com$
Beware that e-Commerce transactions can't be filtered by hostname but only by transaction ID
I encourage you to keep a 3rd profile without filters, to be able to check that you don't miss anything.
Create two Analytics profiles, one for each site. Then put their respective tracking codes on each site.

Resources