Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Setting up cross domain tracking with google analytics

Sep 17, 2015 2:40PM PDT

Hello to all,

Thank you in advance for taking the time to read this post. I am looking to find a solution as I am trying to upgrade the SEO of my website, but for now it doesnt show any trace of it in Google Analytics.

Here is my configuration :

I currently have 2 hosted domains lets call it hostedA.ca and hostedB.ca.

Here is the configuration of each hosted domain :

hostedA.ca
this hosted domain has an addon domain on it, that is the main used domain. So we will call it maindomain.ca

hostedB.ca
this hosted name has 3 alias domains with 301 Redirect on it. we will call them alias1.ca, alias2.ca, alias3.ca.

All alias redirect to maindomain.ca, and have nothing on it, and hostedB.ca has an index page, and a robot.txt page on it. It has also a 301 redirect to maindomain.ca.

So to resume I have 2 hosted domains but 6 different domain names total.

Here is what I want to achieve :

so the hostedA.ca configuration was done before we came across the company. but the maindomain.ca is the priority. it is our brand, the easiest name, also everything online redirects to it. It is the main account in google analytics as well.
the hostedB.ca is a common mispell of our name that people know, and the 3 alias are direct keywords domain names. I used this configuration following advice from an analytics, SEO book. This purpose is to avoid any risk of penality from Google.com on my maindomain.ca, and any duplicate content.
The point was to improve the search engine on our main domain by adding to it the redirects of the mispell, as well as getting better ranked in the keywords that matters.

so for that part everything works. The problem is : I cannot have any data in Google Analytics on my views from hostedB.ca and my 3 alias.So it gets very difficult for me to measure if there is anyone clicking and if it works has it doesnt appear anywhere.

What I did to try to fix it :
I set up the Cross Domain tracking as directed here : https://support.google.com/analytics/answer/1034342?hl=en&ref_topic=2772342&vid=1-635781183701839477-2965971226

I linked in the code of my maindomain.ca my hostedB.ca domain, and put the analytics code for the secundary doamin name in the index page of hostedB.ca.
Then I copied the view in Analytics, applied the filter... and still nothing. Everything shows like 100% of the trraffic comes from maindomain.ca, even after connecting on it.

What is it that I am doing wrong ? What can I do to make sure I finally get the information I need ? Was Cross domain the right way to do it ?

Thank you very much for your help, and if any one need any additional precision or if I wasnt clear about something, please let me know

Discussion is locked

- Collapse -
Answer
To me it sounds you want standard tracking.
Sep 17, 2015 2:58PM PDT
- Collapse -
Setting up cross domain tracking with google analytics
Sep 24, 2015 2:23AM PDT

The analytics.js library uses a single first-party cookie to store the Client ID that can only be accessed by the domain on which it is set. If you own multiple domains and would like to track users across them, additional work must be done so that the analytics.js cookie data is maintained across each of those domains.


Cross Domain Tracking - Web Tracking (analytics.js)

This guide describes how to track users across domains (cross domain tracking) using analytics.js.
In Universal Analytics, a new referral campaign will be created whenever the document.referrer of a page comes from a hostname that does not match any of the entries in the Referral Exclusion list for your web property.

By default, the Referral Exclusion list includes only the domain that you provided when the web property was first created. To prevent new referral campaigns from being generated when users navigate across domains, you must add an entry for each domain you wish to track across in the Referral Exclusion list. For example, if your default URL was configured as source.com, and you need to track a user across both source.com and destination.com, you will need to add destination.com to the referral exclusion list.
Overview

The analytics.js library uses a single first-party cookie to store the Client ID that can only be accessed by the domain on which it is set. If you own multiple domains and would like to track users across them, additional work must be done so that the analytics.js cookie data is maintained across each of those domains.
Note: This document is only for tracking users across domains where browser restrictions prevent cookies from being shared. Tracking users across subdomains does not require any additional configuration. Read the Domains & Cookies Document for more information about how analytics.js uses cookies.

Lets assume you have 2 root domains, the current source domain: source.com and the target destination domain: destination.com. A common strategy to maintain the cookie data across both domains is as follows:

On the source domain, retrieve the cookie data and append the data as a query parameter to all links pointing to the destination domain.
When a user clicks a link from the source to the destination domain, the query parameter, including the cookie data, will be in the final URL of the destination domain.
On the destination domain, if the query parameter is in the URL and valid, extract the cookie data from the URL and write it to a new cookie on the destination domain.

To simplify these steps, analytics.js provides a bunch of helper functions to get cookie data, append to the URL, and retrieve the cookie data on destination domains.

Car rental Kansas City || Car rental Wichita

- Collapse -
Thank you for your answer
Oct 30, 2015 11:04AM PDT

Thank you very much for this. I am not sure how to implement the cookie data, any available help out there ?

thank you !

- Collapse -
Thank you
Oct 30, 2015 11:03AM PDT

Thank you very much for taking the time to answer. I understand now why it does that !