Google Analytics UAT on another domain - google-analytics

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

Related

UTM tracking across sub-domains

I have a main website (e.g. mybrand.com ) with static pages mostly developed on Wix.com and I have a full application hosted on AWS on a sub-domain, e.g. app..com.
For tracking the traffic coming from different social media channels, we are building UTMs. My understanding is that the UTM tracking doesn't work when you hop between the sub-domains. Can you please suggest some clever options?
One option for us is to re-do the Wix website in WordPress and host WordPress ourselves on AWS next to our WebApp to completely avoid the domain hoping. But if we have a more elegant solution while keeping the Website, it would be preferred.
You can use a simple parameter in querystring (i.e. subdomain.com/page?from=domain1) then in Analytics count unique page with that parameter in the URL.

Can't setup dynamic links with custom domain linked to Squarespace

I'm having issues setting dynamic links with a custom domain. My domain is from Google Domains, and it's linked to a Squarespace site. When I try to add the A records to my domain on Google Domains ... it says the records already exist. And I can't figure out how to override or remove them. Or if that will mess up my linkage to Squarespace. Thanks!
Few of things I was missing, with great help from the Firebase slack channel:
First, You can't use the same domain as your Squarespace domain. You'll need to create a subdomain. I used link.???.com
Second, when I changed the DNS settings, Firebase instructions ask you to add two A records. But the second always fails saying it already exists. Support folks said you only need one, the second is for redundancy. Instructions should state this!
Next, I was missing steps 1 and 3 in these instructions. For step 3, make sure you create the property as an array.

How to track single folder traffic in 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

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