Is it possible to create a virtual pageview from an event using a custom filter? - google-analytics

I've released a mobile app (Android) which I track using Google Analytics. As my experience with Google Analytics is little, I did some mistakes by not knowing when to use events versus virtual pageviews.
My app has a login and a signup screen and I'd like to track the conversion rate of users signing up for an account. The app tracks the page views (/Account/Login and /Account/Create Account) and the actual login and account creation as individual events (Category: Account, Action:Logged In and Account Created).
So here's my problem: In order to do a nice funnel analysis, I should have created virtual pageviews instead of events if the user logs in or creates an account. Though I can create a goal based on events it will not tell me the drop off rates in the individual steps the user takes. Only the funnel visualization can do this AFAIK.
Is there a way to automatically create page views using custom filters in Google Analytics? I've tried to setup a filter like this:
Field A -> Extract A Event Category Account
Field B -> Extract B Event Action (Account Created|Logged In)
Output To -> Constructor Request URI /Account/$B1
Field A Required Yes
Field B Required Yes
Override Output Field Yes
Case Sensitive No
However, that doesn't seem to work. I do not see any additional page views or any other changes. Any suggestions?
(Of course I could release an update to the app and I will probably also do this soon, but the above solution would help me with my experiments right now - without having to alter the source code every time I have "a new idea" how to improve the analytics data)

Unfortunately I've found that it's impossible to achieve this without updating the mobile clients. However, moving forward I will take a closer look at Google Tag Manager which allows much greater flexibility.

Related

GA Management API Update Users Custom Dimension value, Goal Tracking strategy

So Let's assume I have a custom event inside my APP and I push custom dimension that has a certain value,
Is it possible through GA Management API to get that Custom Dimension by the value and then update it to the new value?
What I'm trying to achieve is, I want to track when user do his first paying process inside the app and to compare how many users that hit the first Goal (Signup) ended up paying it, what's the best way to do that thru the GA?
Thanks!
You cannot update historical data in Google Analytics.
You can track userId, sessionId and hitTimestamp information as custom dimensions and work on it: https://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/

Track individual via Google Analytics

I am new to Google Analytics. I have a conversion set up, and I'd like to capture demographics for individuals who convert at e individual level. When a user converts, I'd like to pass the statistics from Google Analytics into my own database, or keep a record of the ID assigned at conversion in Google Analytics and download the data. Is this possible? I want to do analysis on who is likely to convert versus not - age, shopping habits, etc - and link these details back to the type of specific conversion.
Thoughts?
We if want to add add track users at individual level, try creating a Custom diamension and passing the userID everytime you make a GA call.
Next to view the same :- in tables that you view your analytics data, there will be this option called 'Secondary diamention', from the list that appears.. Choose the custom diamension name that you had assigned. Now you will be able to see each row with the userID along slide.
Add user ID to your tracking script
The first step to your question is to add the user ID to your tracking. If you have some way to identify users on your website (ie: through email marketing tool, your CRM, etc), then you should set up user ID tracking. Here is the Google Dev article about that:
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id?hl=en
However, basically... you just have to add this to your tracking script (replacing the 'create' line you currently have, replacing "USER_ID" with the user ID your system gives them.
ga('create', 'UA-XXXXX-Y', { 'userId': USER_ID });
In addition, I usually include this UserID as a custom dimension, so that I can view it in Google Analytics and other reports. To do this, first set up a custom dimension for your ID, as a "User-level" dimension. Then just add this after your user ID is available (assuming this is your first custom dimension):
ga('set', 'dimension1', USER_ID);
Connect User ID to Demographics
Unfortunately, the demographics information that Google Analytics provides (under "Audience") is not compatible with custom dimensions (like userID). So, the API only allows you to pull the audience data in aggregate (ie: connected to City, number of users, pageviews of those types of people... etc). If this works for you, check out the GA Query Explorer (below) to try out different combinations of dimensions & metrics to drill down as deep as you can and maximize the information you gain from this demographic info.
Connect Google Analytics Data to Your Database
In order to connect GA data to your database in an automated fashion, you will need to set up some kind of scheduled process that runs a query off of the Google Analytics API. To explore what combinations of metrics and stuff are available, I'd suggest checking out the Google Analytics API Explorer and the Google Analytics API reference material. What I did was set up an SSIS package (using SSIS GoogleAnalyticsSource) as the data source, which made it fairly easy. Then just scheduled that to run daily, populating the data I want into my database.
Alternatively, you could download less complicated reports directly from Google Analytics and import them into your database with something like SQL Server Management Studio.

Query Google Analytics by User ID

Is there a way to query results using the Core Reporting API (v3) and filtering those results by the User ID assuming that it is being sent to Google Analytics properly?
I've googled this question a lot and read a whole bunch of articles but I did not find one place that does that. Moreover, the fact that I cannot see the User ID anywhere in the reporting interface makes me doubt that this is even possible. I'm guessing I will have to dome something similar to what is recommended here in order to do it?
UPDATE
Apparently, the purpose of my question is not very clear as highlighted by Eike's comment below. What I want to do is generate a report for a specific user with a specific Id using the client API and then combine those results with information I have about this user in my system's database to do something as per my business requirements.
The best place to turn to for such questions is the Dimensions and Metrics Reference. If the dimension you're looking for is not there then you cannot query it or use it in a filter.
The list is really well maintained, so it's not very likely there are as-of-yet undocumented dimensions you could use.
User id is not there.
Well there is a way now.
The docs says the following steps
Set up User-ID in your account
Agree to the User-ID Policy
Read the User-ID Policy. Under I agree to the User-ID Policy, set the switch to ON. Agreeing to the policy enables the feature in your account.
Click Next Step.
2. Set up User-ID in your tracking code
After you enable User-ID by agreeing to the policy, you must implement User-ID in your tracking code.
To employ User-ID, you must be able to generate your own unique IDs, assign IDs to new users and consistently reassign the same IDs to returning users, and include these IDs in the data you send to Analytics.
In this step, you can see the line of code that you have to add to your Analytics tracking code:
ga('set', 'userId', {{USER_ID}}); // Set the user ID using signed-in
user_id.
3. Create a User-ID reporting view
User-ID data can appear only in a dedicated User-ID view.
Click Create.
Enter a Reporting View Name.
You might want to include the term "User ID" in the name to help you remember that this is a special User-ID view.
Select a Reporting Time Zone.
Under Show User-ID Reports, set the switch to ON.
Click Create.
Related resources
https://support.google.com/analytics/answer/3123666?hl=en

how to turn Google analytics on or off depending on user log in?

I currently have website (vb.net) that uses google analytics and it has been working fine. What i want to do is turn off GA when the employees of my company log in and turn in on when the clients use it. Each login has a unique id so the first thing that i thought of was to just check the id and add/remove the GA code depending on who logs in. I'm not sure if doing this will affect the stats in any way. Are there other ways to achieve this? Thanks
Depending on your use case, it could be better to utilize this data by placing it within a custom variable, saying if the member is an employee or a regular user. Within the reporting you could then segment the traffic based on value. In most cases this will be the better option as you won't have an inflated drop off rate at the login screen.
If you're still needing to abort the calls, you have a few options:
Add the JavaScript window['ga-disable-UA-#######-##'] = true; on the page. This will need to be done before you call the normal Google Analytics code.
Add logic to fire or not include the entire Google Analytics code block if the user is within a certain group or has a certain ID. This will obviously depend on what language you're developing in.

How can I report custom events by visitor in Google Analytics

We use custom event tracking in our web application with Google Analytics to report user's behavior (for example - user clicks on key actions, client side errors, time measurements, etc.)
Each time the Google Analytics code is run on the client, we set a custom variable at the Visitor session to set the actual username of the user.
How do you use Google Analytics to report a table of all the custom events by visitor?
Our goal is to be able to have a storyline for each user, with all the events produced by the application correlated to its username.
There are no standard reporting views in Google Analytics that will give you this full view by default.
The best way to do this is with Custom Reports: Create a flat table custom report that has the custom variable value as a dimension, and the custom event dimension you're interested as another dimension. Then, set the metrics you want (total or unique event hits, presumably), and set the filter to filter down to the specific event category or action you want to view against.
Below I have an API recommendations (from a previous version of this answer) for how to pull this, but it would be roughly the same for creating a custom report.
Depending on your exact needs, the API call would be structured something like:
Metrics: ga:totalEvents
Dimensions: ga:customVarValue1,ga:eventCategory,ga:eventAction,ga:eventLabel
Filters: gaEventCategory==Foo

Resources