Traffic from logged in users with Google Analytics - google-analytics

I would like to separate out the traffic between logged in users and users who have not logged into our site. The Sensr.net login link in the top right of the page turns into the user name when they are logged in. Is there a way to use this DOM state to segment the GA stats?
We have integer user ids from our database, should we use custom variables and put the Sensr.net UID into one of the custom variables?

Advance segments and Event Tracking is not wrong, you can use them creatively. But custom variables are there to track situations like this.
There are three main options such as Visitor Level, Session Level and Page Level. Visitor Level is recommended for this situation.
I will submit some referrals which will be very useful.
1) http://www.lunametrics.com/blog/2012/08/28/20-ways-use-custom-variables/
2) http://online-behavior.com/analytics/custom-variables-segmentation

Couldn't you create a new advanced segment where one of the conditions (or the only one for that matter) is that they should've visited a certain url, i.e. login confirmed? Or when it's ajax based you could try creating an event for that action and create a segment for that specific event.

Related

How can I track individual user activity on a Squarespace website without using Member Areas?

A bit of background:
I have a very simple Squarespace website, where I've created a manual form set up that takes in a user's email and a password for them to "login". They can only view the website once they're logged in. I didn't use Squarespace's features (like Member Areas) because they contain far too many undesirable features that are unable to be turned off (for example, I can't turn off automatic emails sent to users, I can't stop Squarespace from asking for first and last name, etc).
Now, I've been trying to figure out how to use Google Analytics' User ID feature (Universal Analytics, not GA 4 because GA 4 doesn't have great documentation yet and its features are still quite limited) in Squarespace so I can track the pages individual users view, but it's been giving me an insane amount of problems that aren't super well documented (from what I've seen at least). The biggest problem that I've been running into is that since my user ID is derived from the user's email (along with additional randomized numbers), I can get individual user info at the login page from the form submission, but I don't know how to keep this user info such that after the user is logged in and viewing various pages, I can still keep track of the user ID and enter it as a parameter in the GA configuration code for each page. I haven't seen evidence of a global variable system in Squarespace where I can store this user ID, so I'm pretty stumped (though I would be happy to know if someone knows of something similar).
Does anyone have any idea how I can individually track user activity on Squarespace without using Member Areas?
If you use the User-ID view you must send the user id in all hits, otherwise you will not see interactions in that view where that information is not present.
As an alternative (recommended) you can use a custom dimension at the user level, in that way you just need to send the userId even once, collect it in the custom dimension and from that moment on (including previous interactions of that same session) navigation of that user (also for subsequent sessions) will be associated with that identifier in Analytics.

GA Page View tracking with additional information

We have a site where users login to access technical information. Before accessing the information, they also have to enter a set of filter options. Different filter options result in different information displayed on different pages but the url is the same.
For example, a user will get the following URL when accessing a specific document, regardless of what filter options set:
www.site.com/fr/category/document/
Depending on the filter options, different sections of the document will be visible.
Currently, no information in GA tells us what filters were used when visiting the page. We do not want to add filter parameters to the URL. At least not for the visitor, but maybe add it in the tracking somehow?
What would be the optimal/correct way to track that kind of information?
Best solution may depends how your site works etc. But how about using custom dimensions assigned to "hit" (pageview) scope? Maybe they will help in your case? Documentation: https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets (code in documentation depends how your GA is implemented of course). Thanks to them you can send with pageviews hit additional (custom) information (e.g which filters were used).
Other way could be just sending google analytics event (https://developers.google.com/analytics/devguides/collection/analyticsjs/events) with information which filters were used before pageview hit. Then just in Google Analytics panel you can create custom segment with sequence where 2 events occurred:
Click (or use filters) - event
See specific URL - pageview
Or of course you can implement both solutions (custom dimensions for pageview and events).

Programmatically track subdomains in different view for google analytics

I've a site which allows users to register, creating a store front page like a shopping cart for them to customize. Each page is a subdomain of the main page, and is coded using one jsp.
Eg: User creates store front page named "abc", his store front page will be abc.mydomain.com
Is there a way to track these different subdomains individually separately using google analytics programmitically?
I've googled and currently did it by creating views and filters, but as i researched there are no way to create these views and filters programmitically, having to go to the google analytics page to create at there. I saw there is also a limit of views one can create thus am wondering if there are any other solution to this.
Thank You
You can use the Management API to create, update, and delete profiles, but as you've found out there is a limit of 50 profiles (views) per non-premium account. I would say to use advanced segments to segment out hostnames, but again there is also a limit of 100 advanced segments per view. One idea (and I haven't tested this) could be that when a user creates an account, they create a sub subdomain abc.foo.mydomain.com, and after there have been 100 sub subdomains created, switch the subdomain to bar.mydomain.com, etc. This way, you could get 5000 possible combinations. Again, you would want to test.
One other option, and this is similar to what Shopify does, is to have the user input their own GA account through the admin - but the downfall of this is that you (the site designer) wouldn't have visibility into that subdomains data.
Anyway, hope this helps.

How to track one domain from two google analytics account?

We got one domain that has data for different client. What we wanna do is have a separate Google Analytics profile under one account to track traffic data for each of their pages.
In other word, in google analytics code can we have two Account id ? So both accounts can get see the tracking data for specific pages.
I think I have not made myself clear yet. let me try again..
There is one domain abc.com with several pages. For example abc.com/xvy belongs to userA and abc.com/kju belongs to userB. We have one google Analytics account that is tracking everything on abc.com. What I want to do is have another profile or new google analytics account to track all the data belongs to userA and userB separately. I do have an option to put different tracking code on pages that belongs to different users.
For example, pages belongs to userA can have diferent tracking from pages belong to userB.
But at the same time I want to track all the pages under one account as well...
Is there anyway I can achieve that ?
You should set up a separate profile for each area of the site you want tracked separately. Profiles all belong to the same account, so you will be able to see all of your data with a single sign-in.
Keep the same tracking code on all areas of the site, but just apply filters to the different profiles.
To follow your example, I would set up Profile A and Profile B. You could keep a Whole Site profile to collect all of the data, too, if that is useful to you. For Profile A, apply a Request URI filter for ^/xvy and for Profile B, apply a Request URI filter for ^/kju. I'm assuming here that the different areas of the site are defined by the first subdirectory, so you may have to adjust those filter suggestions if the structure of the site is different.

tracking users with google analytics after they leave my domain to make a purchase and come back

I would like to track where users originally came from when they make a purchase on my site so I know which keywords are more profitable and which websites are best for advertising.
an example is a user is on my site with my google analytics tracking code which has details of where they came from, and then decides to upgrade. they leave my domain to go to my biller (2checkout) complete the purchase and return to my thank you page.
I have transaction code and analytics code on my thank you page and the transactions are showing up with the correct product/amounts in GA however there is no other data and in my reports the referring url is always my biller or a credit card companies authorisation page.
i can manually connect which customer is which by saving their referring data when they first come to the site and then matching it up after they make a sale, but I would like it to show up in my google adwords / analytics account where it is easier to manipulate the data and see trends.
if anyone can help me with this annoying issue I would be vbery greatful, but I fear I may end up living off reports I create and then matching them up with adwords manually :/
One thing you can do is have a click event trigger a custom variable. When the user clicks on whatever link that takes them to your biller, have the custom variable trigger with the information you want to carry over (like the current page URL, some campaign name, whatever). Specify the custom variable's scope as Session or Visit so that it get associated with the thank you page.
http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html
An alternative is to do campaign tracking:
http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55540
That is more or less the same principle as the first suggestion, but with using specified URL parameters. Depending on how your pages are actually coded, you may need to push a virtual page view with the campaign code(s):
http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55521

Resources