Google Analytics Multiple Profiles - google-analytics

We have a large number of websites (>50) which we wish to track using analytics software. We also wish to track the total number of visits across all sites from one console.
I have done some research, and the supported way to do this by google is to install one 'msater' tracking profile, and use filters to create child profiles on each domain. However, this does not allow more than 49 different sites to be created due to the 50 site maximum, which means that having about 300 sites would result in 6 'master' profiles, which then need to be manually combined.
I have also tried multiple profiles per site using custom variables, e.g.
var _gaq = _gaq || [];
_gaq.push(['t1._setAccount', 'UA-xxx-01']);
_gaq.push(['t1._setAllowLinker', true]);
_gaq.push(['t1._trackPageview']);
var _gaq = _gaq || [];
_gaq.push(['t2._setAccount', 'UA-xxx-02']);
_gaq.push(['t2._setAllowLinker', true]);
_gaq.push(['t2._trackPageview']);
However I read that this may result in the data not properly being recorded, and seems to be strongly disproved of by Google.
Is there a simple way to combine multiple profiles? If possible, i'd rather stick with Google, and we're under a tight budget so can't afford the google analytics tools available.

Google doesn't support this approach because you need to be aware of some things a bit on the technical site. With that said, what you're trying to do is possible, just be sure to review your data. You do have a limited number of profiles that can only be increased by Google - you would have to go through a Google Analytics Certified Partner since they're the only ones that can request that directly (and they still might say no).
The better way to do it is an account approach. When you hit your limit start making accounts from another set of login credentials, add your original email as an administrator, then remove the secondary user from the account (so you don't hit the limit again).
The technical issue you need to pay attention to is Google Analytics creating multiple sets of cookies per pageload. On subsequent page views it's a crapshoot which set of cookies it'll pick, so you'll see high new visitors, high bounce rates, and pretty unusable data. Call the _setAllowHash method properly and you'll avoid the issue by letting GA share the cookies.

OK, according to the official Google Analytics Developer guides, the correct way of doing this is by using the following code:
_gaq.push(
['_setAccount', 'UA-XXXXX-1'],
['_trackPageview'],
['b._setAccount', 'UA-XXXXX-2'],
['b._trackPageview']
);
https://developers.google.com/analytics/devguides/collection/gajs/#MultipleCommands
Tho, as above, Google says this way of doing things isn't 100% supported.

Related

Google analytics track user behavior. Or possible?

I am searching for a way to track user behavior on my website. I want to know if it is possible to get a table with data looking something like this:
+------+---------------+-----------------+------+---------+
| time | ip or user_id | user_session_id | link | actions |
+------+---------------+-----------------+------+---------+
(Link - where user came from)
I want to track different user actions by sessions. Is this possible using Google Analytics or I should search other tools? My site is currently set up to track events but on my Analytics account I get only the number of events that occurred. I want to track what a specific user does on my site.
tl;dr: if you must do this use Mixpanel or similar software.
Time based dimensions are already available (date, hour, minutes and datetime). "link" would be referrer. Actions in Google Analytics are basically pageviews, events and transactions, so you have that, too.
IP and user id are a big no-gos. Storing anything that that identifies a person is a violation of Googles Terms of Service and depending on your location might be a violation of national laws.And if by user_id you mean the Google Analytics feature of the same name, Google says you may set it for logged in users and have to unset it for user that log out, so by extension that means storing it in Ga would probably be a violation of their TOS.
The GA session id is not exposed via the interface. You may read it from the cookie and store it in a custom dimension (I'm not sure if this is allowed within the TOS, on the other hand GA premium customers get this via a BigQuery export in any case, so it should be allowed).
If you simply want to tell different users apart you might simply generate a string in the UUID format and store that in a custom dimension. If you want to actually identify users (by name, adress etc), well, you are not allowed to and Google will terminate your account if they find out.
Not to mention that it completely eludes why so many people want to track individual users. You must not use GA information to target individuals, and simply looking at individual user paths will not help you (I wrote an article about that, although I do not expect that this will convince you).
Google Analytics is for technical and legal reasons not a good tool for tracking individual users, if you need to do this use a software that is made for this purpose. Mixpanel is often mentioned in that context but I'm sure there are many other solutions.

How can I pull data from Google Analytics to see the top pages visited from the current page?

I would like to create a small sidebar on each page of my website that contains related/popular pages with perhaps the top five pages users visit after reading the current page.
I could track and record user movements across the site myself and build the list that way, but as my site already uses Google Analytics and I know the data is there I'd rather access that if all possible.
The trouble is that I don't have the faintest idea whether it is possible or not.
Remember that the Google Analytics Reporting API is not real-time it can take between 24 - 48 hours for the data to finish processing and be in the API for you to request.
The Realtime Google Analytics api is real time but the data is only about 5 minutes old and its very limited to the dimensions and metrics you can request.
Quota, with either of those APIs you are limited to 10,000 requests per day per profile / view. I have no idea how many pages there are on your site or how may users are on your site but this could quickly blow out this NON extendable quota.
Options: Except that its not realtime data and use the reporting api every night run a request against the api get everything for two days ago then show your users on your site data that's two days old. Store the data in the database then you are showing them data on in your DB and wont have an issue with the quota as you only requested it once.
But this isn't exactly what you want as its not showing a users activity over the site. TBH I am not sure you can exactly use Google Analytics to track a user as the data is user non specific.
If you don't want to get involved with learning the API and develop this from the ground up, check out EmbeddedAnalytics (disclaimer: I created the service). We could provide such a widget.
You may find This Article useful. It provides the necessary query to find the "next page visited" using the page of interest as a filter. Ultimately your query would look like this:
https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3Aabc&start-date=30daysAgo&end-date=yesterday&metrics=ga%3Apageviews&dimensions=ga%3ApreviousPagePath%2Cga%3AnextPagePath&sort=-ga%3Apageviews&filters=ga%3ApreviousPagePath%3D%40pricing
The query above will give you the "Next Page" along with pageviews assuming the "previous" page contains the word "pricing".
We could easily build such report widget for you:
You would insert a javascript source code snippet into your page. The javascript would pass the page url to our server and we would return the next "most popular pages visited".
The pages could be "linkified" so that someone could click the link to go to that page.
We already have caching mechanism in place. So each pageview would not require a new query to google (making it quicker and also staying away from the API quota that was mentioned above). For pages that are hardly ever looked at (e.g. less than once a week), we could make "on-demand" calls to get the statistics.
In my experience with the API, the lag in the API is only a couple hours. It may be longer for larger sites.
Please let me know if you are interested in such widget and I can work with you.

Google analytics viewing access by userID

I have asked this question several times over on the GA forum, but no result. So maybe you guys can help...
I have set up google analytics with userIds on various pages of a site, with the aim of identifying exactly which pages are looked at by which users. So, sending GA the string
ga('create', 'UA-39536320-1', {'userId': '1001'});
means GA keeps track of all accesses by user 1001, and I can then (in theory) track all pages looked at by this user.
Trouble is, GA reporting seems to offer no out-of-the-box way of doing this. Indeed, some of the reporting features supposedly enabled by GA with userIds just don't seem to be available (eg coverage; user engagement; etc).
Am I the only one trying to do this? Seems other people have achieved a similar result using custom variables; do I have to do that, and give up on GA userIds?
The userId feature can be used in conjunction with a user id enabled view (profile) to analyze cross device sessions.
As pointed out by DalmTo it is possible to use custom dimensions to track any non PII information about a user. This article here gives a good example combining sending user scoped custom dimensions along with imported CRM user data to analyze and segments users for remarketing purposes.

Multiple references to a single google analytics account on one page

I'm trying to pin down the reason for a discrepancy in Google Ecommerce tracking for a client, with most reports reporting values about 10 times higher than they should be.
So far the only fault I've been able to find in the tracking implementation is that _gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
is being set twice, both times to point at the same account.
This seems like it might potentially mess up the tracking, but the analytics console I'm using is reporting normal beacon activity.
Does anyone know if this configuration has any effect on how Google reports data?
This won't bother Google, the second call will simply overwrite the first (would be different for trackPageView or trackEvent or other interaction calls, but not a problem when you set the account id).

Can Google Analytics do a user's who looked at x also looked at y?

Just wondering if this this possible? I realise you could never use it to display recommendations on a page but it would be useful from an analytics point of view to see for example what other products user's who've looked at product x have also looked at.
You can use Advanced Segmentation to do this.
Advanced Segments slice Google Analytics data on the basis of sessions. Sessions are a collection of pageviews that correspond to the popular notion of a visit.
If you create an Advanced Segment for users who visited /product/x/, it will return data from all the sessions in which that page was viewed. (Similarly, you could create a segment for /product/x AND /product/y. From there, you could filter it to only include your product pages, and exclude the original products themselves.) As a result, this session-based querying is perfect for your use case.
So, yes, you could use Google Analytics API data to inform a simple recommendations engine. The only caveat I'd give is that the Google Analytics API is a little slow, so you'd want to cache the data locally in your app, rather than querying it directly on every pageload.

Resources