How to track single folder traffic in Google analytics? - google-analytics

I have forum directory on my website. That sub directory is located on http://www.mobilestore.pk/forum I was wondering that how can I track forum traffic only as a separate property in Google Analytics without filtering it from the whole traffic of the website. So I can show the trends of forum to Moderators or Editors.

I don't recommend using a property to break out traffic on the same domain. It's better to use a new view with a filter. Be sure to keep a view that is unfiltered.
If you do decide to use a separate property, you will need to modify the code in all the page templates used in the /forum path to use a different UA tracking ID.

You can add a 2nd tracker for just the forum.
As per Google:
"In some cases you might want to send data to multiple web properties from a single page. This is useful for sites that have multiple owners overseeing sections of a site; each owner could view their own web property."
This exactly fits your scenario
See https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#multipletrackers

Related

Google Analytics UAT on another domain

It seems that a company from Korea downloaded our front-end html/CSS files and built a website, but they did not bother to remove our UAT number and now our analytics are full of misleading traffic from their website. Already contacted them to remove it but is there a way to exclude entirely the data from that domain?
At view level, you can use a custom filter to block it. You've got a few pre-set options on what to block - by hostname or by country, or an entirely custom definition. This won't back-date, a segment with the same sort of filters will do it for existing data.
A hostname filter is probably the best if it is a single website that has copied your code. As mentioned above, it will not back-date

Google Analytics: share data between multiple accounts?

currently we have a company blog that runs via blog.domain.com. Also we have our corporate site (domain.com) that is our "selling" site. The blog is about tutorials, open source stuff, totally non profit.
We want to examine if the blog has value to our business. Branding and so on... Will customers visit our blog, are users from our blog more likely to buy sth and so on.
Both Domains are within the same Google Analytics Account but as separate properties. Is it somehow possible?
I dont want to use something with Referal as solution since it just might be that someone visits our blog and returns after some week via an ad.
You cant analyse Google Analytics data across properties or accounts. Data can only be analyzed within the same property.
This is why its best not to split data between properties but to store everything in the same property when its the same web account. At the very least having one default property with all of the data can also be useful.

How can Google Analytics be used to track the different websites within a homegrown CMS?

I own and operate my own Content Management System (CMS) web application targeted at a specific type of customer (schools). Each customer wants to track the traffic to their own website. Of course, I could ask them to each create their own Google Analytics account and then provide me with the tracking ID so that my CMS can embed the correct code onto their pages. But I was wondering if there was a better way ... something more automated, and something that involves less work on their part.
I was thinking that for each customer, I could use the Google Analytics APIs to automatically create a new Property with the appropriate filter and then give the customer "Read & Analyze" permissions for that property. The problem with that is that I'm limited to creating 50 properties under my account.
Any other ideas? I'm just wondering if I'm missing some feature of GA that is specifically designed for this scenario.
Thanks,
Rajeev
Asking each user to create their own analytics account is the correct solution. Then they should just give your cms the id, and then your cms should include the correct analytics javascript code. It's the way all other cms systems supports Google Analytics

Google Analytics Tracking across subdomain and one specific subdirectory

I've gone through all the GA documentation and understand pretty well how to track across subdomains. I need to do something slightly different. My sites are moving from subdomains to subdirs onto one subdomain (www). From site1.domain.com to www.domain.com/site1, etc. Previously, there was nothing on www, only the subdomains, which all have their own tracking id, ie. 12345-2, 12345-3, etc. Both sites (old and new) will be live at the same time, so we need to aggregate and track across the subdomains (got that down, w/ all the filters needed) but also track/link only a specific directory on the www to each of the old subdomains. One kink is that while all the sites will map easily from site1.domain.com -> www.domain.com/site1, one special site - online.domain.com will map to www.domain.com/ with no subdir.
I figured I could solve the subdir issue by only placing the code for each property id on the respective subdir pages. I.e. site1=12345-2, and all the pages in /site1 get that code. For the online.domain.com site, the property-id specific code would have to be added to about 20 other subdirs, like /about/, /contact/, etc. Is this correct or kludgy? And i might even add new profiles that filter for subdir as a backup measure. But the issue I am having is this, I really want to track them as separate sites so that referral, time on site, etc metrics are specific to each subdir (site) and not shared across all the subdomains (which I think what subdomain cross tracking enables.) So I thought the solution was _setCookiePath, but can I use that on one subdomain (www) while cross-tracking and not the other? Because the old site won't have /site1/ as a valid path. Logically, is this something I even can do? Won't setting _setCookiePath on one side defeat the purpose of cross subdomain tracking?
I am confused about the usage of _setCookiePath when tracking subdirectories. When do you use setCookiePath and when do you just filter the data via subdir with profiles? The documentation says if you use _setCookiePath you need to disable tracking at the root level. What is the issue there? (I don't think this would work for me because I also need to track other top-level dirs like /about/). Also in another rollup account I want to track all the sites with one property id and then use filters to set up unique profiles for each subdir/site, eventually retiring the old method that uses multiple profile IDs. But I want to track my subdirs as separate sites with separate cookie info so that a referral to www.domain.com/site1 is not shared with www.domain.com/site2 - is this impossible with my requirements? More importantly, visits and uniques need to be segmented by subdir. A user that comes to /site1 then goes to /site2 needs to be a new visitor on /site2.
Update: did I totally overthink this? Since users probably wont be moving between old and new sites can I just add the same tracking property id to both sites w/o crossdomain tracking? That would help me consolidate old and new, but I still have the issue of how to track all the new subdir sites as different sites that don't share cookie info.
It sounds to me like you are moving from a more complex set up to a far simpler one.
If your new domain structure is:
www.site.com/one
www.site.com/two
www.site.com/three
www.site.com/four
Then the standard default Google Analytics code snippet will work. IE Without cross domain tracking, just select 'single domain' when setting up your new profile.
The only issue i can see is that current your data is stored in different profiles. Using this new setup all data will be stored in one single profile. However using the 'Page' metric you could create advanced segments to separate traffic visiting 'Pages' beginning with '/one' for example. Or you could create multiple filters with Page based filtering to separate the traffic from 'www.site.com/one' from 'www.site.com/two'.

Google Analytics - only track traffic to a folder of the site

I want to track traffic for mysite.com/current-campaign/ and careless about traffic on mysite.com in general.
Is it ok to place the GA tracking code in the files inside the /current-campaign/ folder or does it HAVE TO be in the root of the server for tracking to work?
GA will only track on the pages you actually put the tracking code on, regardless of where the page is located (unless you start messing with things like domain settings or filters etc..).
So IOW yes, it is okay to do that. If you don't have tracking code on mysite.com/somePage.html then it's not gonna track that page (though it might show up as the URL in some reports like referring URL or exit link or whatever, same as any other page you don't track)
In Google Analytics, you can add a filter to the profile and filter all but the chosen directories. Go to Analytics Settings > Profile Settings and look for "Add Filter" link.
In addition to Crayon's answer, you can limit tracking to a subdirectory by using _setCookiePath() function in your tracking function. See Analytics documentation on single subdirectory (note the link anchor is not resolved to a correct header, at least for me).
This is advised in the documentation to use when you only want to track a subdirectory and avoid clashes with Analytics trackers possibly in use in other subdirectories.
I work for a department in a large university.
The department's web page resides at www.some-uni.com/department-name/.
I only have FTP access to the sub-folder /department-name/ and nothing else on the site.
It was quite easy to get Google Analytics to track traffic within the subfolder /department-name/, ignoring the rest of the site. All I did was create a profile in GA, setting the default url to www.some-uni.com/department-name/. I then pasted the tracking code into the pages I wished to track.
It took about eight hours for anything to show up in GA, but after that it worked just fine.

Resources