how can I know where users come from if they are coming from another website of mine? - google-analytics

I have two websites, website A and website B, the website A is a hotsite that is linked to website B, where the sales happen.
We need to know how the user got the website A and turned into a customer in website B(it means he bought something), so we can mesure the good sources to invest.
as the developer, I have access to these two websites source-code and can implement any google-analytic tag on them.
Thanks,
Jonathan

Web browsers generally send a referrer header, which contains the URL of the page which linked to the current page.
You can access this in the HTTP requests made to site B, and track sessions differently when the first page load is referred by site A. You can also access a document.referrer property in JavaScript, and use it to manipulate your analytics.

The correct way to implement this in Google Analytics is to configure the trackers so that they work cross-domain.
This will allow you to see all the information about where the converting visits originally came from and their path to purchase.
If you don’t use cross-domain tracking or you have it improperly configured, you’ll end up with meaningless data that shows self-referrers in the visit reports and a lack of proper attribution towards your conversion points.  As a visitor moves from your primary domain to the other, they will start a brand new session in Google Analytics.
...
If a visitor clicks an ad or performs and organic search and ends up viewing a page on the www.3rdpartycheckout.com after viewing pages on www.primarydomain.com, you lose ALL data about how that user arrived and the complete picture of what they did.  If they end up converting, you will only know that they came from www.primarydomain.com (which is not helpful at all).
http://www.blastam.com/blog/index.php/2011/02/google-analytics-cross-domain-tracking/

Have the landing page on website B look at the referrer tag and if its website A then use a separate Google Analytics instance on website B for all sessions that were sourced from website A.

Related

Google Analytics: How can I see the referral of a referral?

We have two sites: site A and site B. We manage both.
Site A allows the user to prepare an order which then gets POSTed to site B via a form.
When looking at the GA statistics for site B, I want to be able to see the referral source to site A instead of seeing site A as the referral. How can this be achieved?
Is adding site A to the Referral Exclusion list of site B sufficient? Or do I need to do more than that?
If these are two different GA properties then adding to the referral exclusion list will simply mean that the referring domain appears as direct traffic.
To get the campaign info from the referring domain you would need to set up cross-domain tracking between the two domains.
As an alternative you could store the original traffic source e.g. in a cookie and append it via campaign parameters to all links that go to your other domain. However this would be a lot of work and quite error prone.

Google Analytics - see where users came from

I have two websites with separate google analytics code. I'm curious to know how people get to a specific page in Site A. In GA, if I go to the site content, find the page and then add a secondary parameter for the referer, I can see google, direct, plus some other domains.
How do I see which of my pages people are coming from to view a specific page?

How to track traffic of example.com/?ref=uniqueCode with Google Analytics

I give each visitor who signs up to my Google Form an unique url to my landing page for them to share with their friends. The idea is the more they share and their friends visits the site through their given unique url, I'll move them up the waiting list for a product launch.
So for each visitor I gave them example.com/?ref=uniqueCode which is unique to each visitor. Currently I'm using Google App scripts to programatically generate individual url to each visitor who signs up my Google Form.
The goal is if I see traffic coming in from eg: example.com/?ref=a, and I know tag a belongs to John Doe, I'll move John Doe up the waiting list.
Tried googling for a solution but couldn't find any. All solution directs me to creating a particular campaign in Google Analytics with the URL building which really isn't the right solution for this purpose.
How do I set this up with Google Analytics and track the incoming traffic for each unique code of the ref tags of each user?
Going over your question I cannot see why URL builder does not fit your needs.
However, when it comes to immediate and accurate statistics of incoming referrals you may also use a server side script to track incoming visitors.
Also for lots of existing CMS there are plugins to track referrals. If you use a CMS please update your question.

Google analytics in iframe content (different domain)

I have been reading some google documentation on tracking via google analytics, but still hasn't have a clear understanding of what's happening, I will put this in plain english so that my query can help others as well.
Basically I have 2 sites: siteA.com (parent), and siteB.com (child)
I have created a widget on siteB.com, i.e. siteB.com/widget. Let's say in this case I embed siteB.com/widget on siteA.com (home page)
<iframe src="http://siteB.com/widget"></iframe>
And on siteB.com, I have the relevant google analytics installed. So my question is:
Will siteB.com google analytics be able to register siteA traffic? (one traffic to siteA.com equals to siteB.com/widget.)
Many thanks!
Short Answer : No, It is not as simple
For cross browser tracking:
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite?csw=1#trackingIFrames
In a site where the transfer between domains is done by opening a new
window or by including content in an iFrame, you will need to to
use the _getLinkerUrl() method to transfer visitor and campaign
cookies from one domain to another. For example, suppose you include a
form in an iFrame that is hosted on www.my-example-iframecontent.com.
In order to transfer visitor information from the parent page that
hosts the iFrame on www.example-parent.com, you would use JavaScript
to load the iFrame and pass in the cookie information using the
_getLinkerURL() method.
There are different ways to setup and it all depends on your configuration. Therefore, I suggest that you setup some test profile and experiment with your settings.

Does anyone use Google Analytics? How Google does it to avoid counting the owner of the website as visitor?

I don't want to be counted as visitor every time I test my page in the hosting. Does Google know i'm the owner of the site by checking if i'm logged in my Gmail account?
I don't think Google does anything like this automatically. But they do provide instructions for excluding based on IP address (or range) and apparently also now by cookie. If you use a CMS or admin interface, you could put the code they provide in an HTML file that you then include into the admin interface pages by IFRAME (to ensure that the cookie stays set for anyone who uses that interface).
One option is to install Ghostery addon your browser. Ghostery can block trackers and scripts used on webpages likes google analytics, google adword and other adwares.
You can also block or unblock the trackers for a specific site or specific tracker for a particular site.This add on is available for Firefox and chrome browsers. If you have this installed on your browser, your visit wont be counted as google analytic script wont be executed.
You can learn more about ghostery at: http://www.ghostery.com/about
There are also often application specific ways of blocking google from counting administrators. For example I've used a wordpress analytics plugin that would automatically not include the tracking code if the user was logged in as an administrator. If you are application has the concept as admin then you could write something similar that controls when the code is added.
If you visit your site frequently from connections with a dynamic IP address, eg. home broadband, then excluding IP addresses is not particularly practical. To go beyond IP exclusion, you can create an isolated page on your site that only you know about that includes a call to Analytics to label your cookie.
The Google Analytics _setVar() function lets you label yourself with an arbitrary string, eg. 'internal'. You only need to do this once per browser as long you don't clear your cookies.
Having labelled yourself as 'internal', you can create an Advanced Segment within Google Analytics to exclude visitors with that label.
Google Analytics relay on you embedding a call to their JavaScript see this link - do not confuse it with how Google does page ranking.
So the answer to your question is that your pages should be smart enough to recognize when the request comes from you and skip the call to the JavaScript.

Resources