Measuring goals for users who have never logged into my site before - google-analytics

I have a web app. The home page has two main actions:
Sign up to the application
Log into the application
I have a goal set up for sign-ups. I am trying to track the goal conversion rate of users who have never logged into the application before.
The problem I have at the moment is that the conversion rate is being skewed by users who are visiting the homepage simply to log in.
Is there a simple way of doing this?
Thanks very much,
Ben

For the kind of tracking you are looking for, there should be some coding on both your system and Google Analytics.
First, I would recommend you place into your system the intelligence to know the number of log-ins the user has made (As an example, a counter on your database).
Now, to implement that, you will need to set a Custom Var in Google Analytics in a visit level, to segment the users from the non-users, in that CustomVar, you can store both the user ID and the number of logins he has made.
This is the on the login page:
Your Code Should Look Like:
_gaq.push(['_setCustomVar',
1,
'Member Login',
'NUMBER OF LOGINS', // SET THIS FROM YOUR SYSTEM
2 //VISIT LEVEL Custom Var
]);
Remember that this code should go before tracking the pageview.
After setting this up, you should use Advanced Segments to check those specific users, one case could be: (Using the example above)
Setup an Advanced Segment that "Excludes" the Custom Variable (Key 1) - Mathing RegExp : .*
This will give you all the never-loged user access.
Something else you could do is set up Adv Segments to check on a specific number of logins
Setup an Advanced Segment that "Excludes" the Custom Variable (Key 1) - Mathing RegExp : [^1]
This will give you all the users that loged-in more than once.
You can find more info on Custom Vars here.

Related

Accessing User ID as a variable in Google Tag Manager for mobile

I'm getting started with Google Tag Manager for Android/iOS, and can't find a way to access the User ID as a variable. I can access Firebase User Properties and Event Parameters just fine.
So far, I've tried setting it using FirebaseAnalytics.setUserId and trying to access it as a User Property called user_id / userId.
Some workarounds I've thought of:
Using a CustomVariableProvider (preferred)
Setting the User ID as an Event Parameter (this wouldn't work with built-in events)
I'm just trying to make sure there's no built-in way of doing this before I resort to workarounds. Thanks!
I was not able to find the User ID (or UID) in the list of built-in variables, see this screenshot
There is a built-in way, but it requires quite a sophisticated setup.
In GA version 4 the path is changed comparing to the previous version, where the same could be done much easier via "Tracking Info".
Here are the starting steps in GA4:
Open https://analytics.google.com/analytics/web
Bottom-left corner -> Admin -> Setup Assistant -> Advanced setup -> User ID
Follow the instruction
After that UserID will be available in GTM.
Video guide for exact steps: https://www.youtube.com/watch?v=TVJMFVOXFUQ

How do I pass a parameter from my site into google analytics?

Let's say I have a site and the user comes into it with a parameter:
http://example.com&url=blahblahblah
How do I go about passing along the url value from the parameter into Google Analytics?
1) User comes to the page with a url in the params
2) User clicks a download link with a ga tracking code attached to it which was generated from ga account like this:
http://example.com/download/param1=dkljdf&_ga=1.149898996.39207121.1424368466
You have to create a custom Dimension and a metric for that.
About custom Dimensions and metrics:
https://developers.google.com/analytics/devguides/platform/customdimsmets
After you have created a Dimension, you can add metrics to it by view, in example.
Follow the steps here for Universal Analytics:
https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets
Note that due to not have 10 point of reputation, I wrote the a "_" in http like "ht_tp"
BUT:
I think what you want to know is the number os visitors that clicks a download link in your site that comes from, lets say "blahblahblah" as web origin or other methods.
For that, you have the param utm_source that you can receive directly in the url.
So instead of ht_tp://example.com&url=origin you should receive ht_tp://example.com&utm_source=origin
In this way, you have no care about it. Analytics is going to take care for you so you can get a report of clicks by source.
Or, just use the referer in case all the incoming visitors are from webs:
ga('set', 'referrer', 'ht_tp://example.com');
And a final option, to use Events:
_gaq.push(['_trackEvent', 'ReferencedVisitors', jsVarWhereYouHaveTheOrigin]);

Tracking a conversion funnel that changes subdomains

I am trying to set up Google Analytics (Universal/analytics.js) to track a user account set-up funnel on a single website with many subdomains. On each subdomain, a user can express interest in creating an account, and then create the account. Once the account is created, they leave the subdomain and arrive on the main domain.
For the subdomain foo, the flow is like this:
foo.maindomain.com - register interest
foo.maindomain.com/inv/acc0unTt0k3n - enter account set-up details
maindomain.com/extra_information - info is supplied
maindomain.com/home - goal end point reached
I have set up a View for each subdomain e.g 'Viewing foo.maindomain.com', and each View has a Filter that accurately shows visits to foo.maindomain.com & foo.maindomain.com/inv/acc0unTt0k3n.
I don't know how to go about tracking traffic through this whole funnel. My ideal end-goal would be to track this funnel for all subdomains combined, but I would be satisfied for now with getting a Goal or Funnel that worked for each subdomain individually.
Inside my 'Viewing foo.maindomain.com' View, I have attempted to create a Goal to track this. I can capture the first two steps by creating:
Goal Type > Destination
Destination: /inv/
Funnel: /
This gives a 20% conversion rate, which matches up with my server data for account creations. But if I try to change the Destination to maindomain.com/boarding, and add /inv/ as another step in the Funnel, it no longer works ("Verify this Goal" returns 0).
How can I create a Goal that captures all of these steps?
Make sure you are using the same UA code on every subdomain.
You should then just be able to see all the subdomains in the standard view out of the box - UA tracks across subdomains automatically. See the Google documentation for details
You don't need to set up a view for each subdomain if you don't need it.
Name your master View "Rollup" if you like.
You can see all subdomains in your "Hostname" report for that view.
You may want to overwrite your pageview names so they also incude the subdomain, so you can tell them apart (if say subdomain1.domain.com/index.html and subdomain2.domain.com/index.html exist, in the standard pagetracking they will be aggregated) - this can be done via filters:
Filter Type: Custom filter > Advanced
Field A: Hostname Extract A: (.*)
Field B: Request URI Extract: (.*)
Output To: Request URI Constructor: $A1$B1

tracking sign-ups with google analytics

our marketing consultant has asked me to help with configuring google analytics to setup Goal Tracking for User Signups... from what I've read this is accomplished by assigning the URL of the page the user is directed to after a successful signup to the Goal you are trying to track.
but what if the URL your user is directed to is a URL they regularly visit? e.g. after signing up they are directed to their profile page - which is the same page they visit every time they login. is there some way to configure a referer to go with the goal URL so that it is the pair of them that define the goal? e.g. user visits /profile and is referred by /signup.
further complication: what if after signup the user is directed to a different page depending on the user type? it would be nice to configure a single Goal with multiple URLs (but still using the referer restriction described above).
an alternative would be to use an event... if the server creates a user then it could signal the view to output the javascript code that generates the appropriate event.
or... is there a way for server-side code to send events to google analytics? is there an api?
If your users are directed to is a URL they regularly visit you can make a conditional statement for the goal occasion with a virtual pageview, have a look at this: http://services.google.com/analytics/breeze/en/et_vps/index.html
If after signup the user is directed to a different page depending on the user type, you can use regular expressions to set goal URL pattern, like this ^user./login./(type1|type2|type3)/$, look here for more info: http://services.google.com/analytics/breeze/en/regex_ga/index.html
I came across this question in google and believe I found a more appropriate answer.
Google Analytics now provide a service called Analytics Measurement Protocol.
This will allow you to send server-side requests to track your users activities in your analytics account.
To track a sign up event as mentioned in the question, the best way I can see would be to first create an event based goal in your account with the category set to 'users' and an action as 'sign_up' (you can optionally provide a label and value). Then in your code once a successful sign-up occurs (maybe when a user confirms their activation email link?), send a POST request to www.google-analytics.com/collect with the following payload:
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=user // Event Category. Required.
&ea=sign_up // Event Action. Required.
&el=label // Event label.
&ev=1 // Event value.
A full list of the parameters and their meanings are defined here: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
You could use an event that is triggered when the user submits the sign-up form :
onsubmit="_gaq.push(['_trackEvent', 'Category','Action','Label','Value']);"
and use the Category / Action / Label data model in Google Analytics to pass whatever data you need to pass, for example :
onsubmit="_gaq.push(['_trackEvent', 'Sign-up','Premium','6-month',6]);"
You then have to configure this Goal in Google Analytics as an Event, which lets you choose which combination of each of the fields Category / Action / Label / Value you want to use.
Another option, maybe less maintenance-heavy, is to use a query-string to identify people that get back to the Profile page after having just signed up. So instead of sending them back to /user/profile after they sign up, you send them back to /user/profile/?sign-up=true.
You will then be able to track these pages as a URL goal in GA using a Regular expression like :
\?sign-up=true
I wrote a helper function for tracking GA events.
function trackGoogleAnalyticsEvent(category, action, label) {
try {
ga('send', 'event', category, action, label);
} catch (e) {
console.warn('Google analytics error: ' + e);
}
}
Usage:
trackGoogleAnalyticsEvent('Signup', 'Signup Success', 'Facebook');

How does one associate Google Analytics with a particular authenticated user?

What method would you use to associate tracking information in Google Analytics with a particular named user?
I want to be able to do custom reports, and ultimately drill down on usage by user.
EDIT
I was thinking that perhaps the EventTracking API would be able to help somehow.
Also, referring to this documentation.
You could add the user's username as a tracking/segmentation) variable...
pageTracker._setVar(username);
You can only use one _setVar per page, though...
http://www.google.com/support/analytics/bin/answer.py?answer=57045
http://groups.google.com/group/analytics-help-basics/browse_thread/thread/07e29dc610050971
Since Google Analytics isn't aware of users who are logged into your site you'd have to do that sort of tracking within your site's software itself. If there isn't some sort of plugin or extension out there already you'll probably have to write one yourself that keeps track of what your users do when their logged in.
I think you want Google Analytics - Custom Variables. You can set five variables per page, and there is support for variables you set persisting over session and cookie (aka "visitor") lifetime. Take note of the rules for overwriting previous values based upon slot and scope; the documentation explains this with some examples. You should probably include something in a click-wrapped privacy policy about tracking individual users this way; it's somewhat invasive, depending on the purpose of your website.
_gaq.push(['_setCustomVar',
1, // Slot number: [1-5], inclusive. Required.
'Username', // Custom variable name. Required.
username, // Custom variable value. Required.
2 // Scope:
// 1 = visitor/cookie-level, 2 = session-level, 3 = page-level.
// Optional, default=3.
]);
http://www.highlyrelevant.com/2011/03/25/how-to-add-edit-google-analytics-users-to-your-account/
This post was really helpful for me and my team. Not only does it show how to add users, but it also tells you how to edit existing users that aren't setup correctly.
Thanks!
Phil

Resources