Google Analytics _setCustomVar - google-analytics

I have two different _setCustomVar events and I'm wondering if the second _gaq.push() is being triggered properly after the initial one.
Using GA Debugger in Chrome, I can see that the initial push is being processed.
_gaq.push processing "_setCustomVar" for args: "[29,node,true,3]":
And then I see that the tracking beacon is being sent and can confirm this with the utm.gif request params.
However, when I push the second custom variable, onComponentDidMount (react) I see the log,
_gaq.push processing "_setCustomVar" for args: "[32,text,true,2]":
but I don't see a subsequent "tracking beacon sent" log or utm.gif request made.
When exactly does GA dispatch the utm request? Should all my custom variables be pushed onto the gaq array before the initial dispatch, or does a subsequent push to the gaq array automatically trigger a new dispatch?
This post says that you need to set all custom variables before you actually set the _trackPageview Google Analytics _setCustomVar - strange data in my dashboard
Also, I don't see either custom variable in the reporting section of the GA admin tools. All I see are the Custom Variable (Key 1) - Custom Variable (Key 5) links. Shouldn't these custom variables show up as key 29 and 32?

A custom variable must be followed by a hit (pageview, event etc) to be processed (see the example in the documentation), so I assume your second variable is set after your pageview.
At this time you should not use _setCustomVar at all - Google has switched completely to Universal Analytics and while they provide some degree of backwards compatibility with the previous tracking code you really should not rely on it as the Universal Analytics Upgrade Center has announced that support for the ga.js tracking library will be discontinued. You should switch to custom dimensions instead, even if they don't quite provide the same functionality.

Related

GA view filter on server-side tracking not working

I use server-side GA tracking with universal analytics measurement protocol parameters:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
Transaction and product items (with enhanced e-commerce parameters) are shown in GA. I have multiple views and wanted to set a filter for individual view, but no data showed up even though I waited several hours in case there was a delay for data filtering. I only created one filter in my GA account. Say I filtered on Application Name. Here is filter settings:
Filter setting
I am sure parameters were sent to GA. As you can see from post request parameters (hide tid), an=ustest was sent.
POST request parameters:
transaction:
"an=ustest&cu=AUD&ti=US_test_order_2022-05-18_38&tr=100&ts=5&tt=2&ta=galdtest&dr=http%3A%2F%2Fwww.galdtest.com%2Fus%2F&dl=http%3A%2F%2Fwww.galdtest.com%2Fus%2F&cd1=%2Fus%2F&v=1&tid=UA-XXXXXXXXX-Y&cid=5d80d21d-bb0d-477e-b0b0-2b288203df6f&t=transaction"
product data in this transaction:
"an=ustest&cu=AUD&ec=sales&ea=transaction&ti=US_test_order_2022-05-18_38&pa=purchase&pr1id=513&pr1nm=testproduct_1_title%20-%20L42%20%2F%20Blue&pr1br=test_brand&pr1ca=testcategory1%2Ftestcategory2%2Ftestcategory3&pr1pr=390&pr1qt=7&pr1ps=1&v=1&tid=UA-XXXXXXXXX-Y&cid=5d80d21d-bb0d-477e-b0b0-2b288203df6f&t=event"
I tried to create a filter on other parameters as well, but none of them worked.
Did anyone run into similar issue before? Thanks for helping.

iOS: Issues with switching from Google Analytics to Firebase Analytics

I am using Google Analytics for years for my iOS apps and was truly satisfied with it. For my regret Google is sunsetting Google Analytics later this year so I am switching to Firebase API so I can keep tracking my apps. I already done most of the integration work and can see the events appearing in Firebase console. However, I can't see custom parameter values but only event count.
For example, sending event named add_book and adding parameter named isbn with value of 1234, I will be able to see in the console only the number of times that add_book arrived and also that it contains an isbn parameter. However, it seems there is no way to view the value (i.e. 1234) of the isbn parameter. I registered the isbn parameter for the add_book event as required. Am I missing something?
Does having the full functionality of the sunsetting Google Analytics (including advanced filtering + regex filters, etc.), means I should use both Firebase Analytics and BigQuery together?
By the way, I linked Firebase Analytics with BigQuery and exported the data as suggested by Firebase Analytics, but I can't see any Analytics tables yet in BigQuery. Do I need to allow several hours before I can view the exported data?
As of March 2019, Firebase Analytics is not so easy to use or test when setting it up (in comparison to Google Analytics). The main steps for setting up event parameters are:
Send your events with their event parameters. Send at least 80-90 events of one type, otherwise the parameters will appear as zero or "not set", until you reach 80 individual events.
The events will not display in the website until after one day. So wait for 24 hours.
When the events appear on the website, you must register their event parameters, with the '3 dots' menu -> "Edit Parameter Reporting" - Like this:
Then:
(Image credit: Firebase Analytics custom events params and Firebase Analytics. Can not add custom parameter to event )
After registering the event parameters, you must wait another 24 hours to see the parameters displayed on the website.
More info:
https://www.reddit.com/r/androiddev/comments/9zbvk4/alternative_to_google_analytics_not_firebase/
https://www.tatvic.com/blog/firebase-analytics-reporting-tips-overcome-limitations-favorite-mobile-app-analytics-tool-google/
In your event overview from Firebase Console you can enable parameter reporting for individual events. The option is found in the 3 dot overflow menu.
You can do that for up to 10 unique text parameters and 40 unique numeric parameters.
Beyond those limits or for more control BigQuery is the way to go. And yes you need to wait for your first data in BigQuery. They populate a new table with one days data every day once.

Custom trigger showing up in Google Analytics - but NOT the value itself

I have a gtag account setup and that also connects to google analytics.
And I have made a successful tag/trigger to make event tracking for when an FAQ item is opened at my clients FAQ-page
I am sending the trigered FAQ question text as a value as well. And I wish to have a list in Google Analytics in which the questions are shown in a list.
Am I missing something? Should I setup the trigger/tag in another way, or am I missing something in the GA.
Thanks for taking your time.
DEBUGGER
TAG CONFIGURATION:
GA:
The event value in Google Analytics must be a number. You are currently passing {{Click Text}} string, which actually gets ignored by ga object, and will not reach Google Analyitics. More details on event tracking.
Basically, you should send this text data in a text field into Analytics.
Original recommendation, using custom dimensions:
I recommend you to set up a hit based custom dimension, where you can submit additional text data in connection to your event. You'll be able to analyze it as a secondary dimension in standard event reports, or by creating custom reports.
In GTM, you have to modify either the Google Analytics setting variable, or the Analytics tag itself, and assign the desired value (click text in your case) to the custom dimension ID, which you have created in Google Analytics. E.g. custom dimension 6 gets passed like this:
An other option, based on Eike's suggestion:
You can also use any of the other standard event fields for this, e.g. send it in the label. As pointed out, this can even hold larger set of data (500 bytes), compared to custom dimensions (150 bytes). This is also easier to be implemented in GA and GTM as well, as you don't have to deal with custom dimension creation and reporting.

Is Data Layer implementation necessary to push Custom Metrics and Custom Dimension data from Google Tag Manager to Google Analytics

As my heading suggest, I would like to know if it is necessary to implement a Data Layer to push Custom Metrics and Custom Dimension data from Google Tag Manager to Google Analytics.
Some guides I have seen seem to suggest you do not need to implement a Data Layer: http://mixedanalytics.com/blog/custom-metric-ga-google-tag-manager/
However, there are others that suggest you need to: https://campaigntail.com/Blog/Ultimate-Guide-Custom-Dimensions-Metrics-Google-Analytics
When I say implement a Data Layer, what I mean is insert code like this into your website:
// Set value for custom dimension #3.
ga('set', 'dimension3', 'variant a');
// Set value for custom metric #1.
ga('set', 'metric1', 1);
// Send pageview. Passes the dimension and metric to GA.
ga('send', 'pageview');
I have tried implementing the first method but failed. So was wondering what is the right way to go about it.
Thank you.
(Edited because of stupid). Your code example does not show a datalayer, it shows a part of Google Analytics tracking code that wouldn't event work with a standard GTM setup (because GTM uses unique tracker names).
A datalayer is an an array of JSON objects that you can use as a container for your data. However GTM is happy to accept data from almost anywhere, including values that are directly written into your tracking tags. So no, you do not need a datalayer (other than in the sense that GTM will automatically create the datalayer that it needs to function).
Remember the data takes some time (up to 24 hours) to show up, and custom dimensions/metrics are not part of the standard reports. You have to create custom reports, or select your custom dimensions as secondary dimension in a standard report.

Google analytics custom variable, key appears correctly, value does not

Implemented a filter on a webservice to make gif calls to GA for tracking method calls.
During initial testing I set a custom variable that contained account information. But for some reason, after a few weeks the variable stopped coming through to standard reporting correctly.
A test gif url:
http://www.google-analytics.com/__utm.gif?utmwv=4.4sj
&utmn=230567348
&utmhn=localhost
&utmr=-
&utmp=http%3A%2F%2Flocalhost%2Fv2svrmng%2FServiceManagerV2
&utmac=UA-12345678-9
&utmcc=__utma%3D999.999.999.999.999.1%3B
&utmvid=0x6ffa39da7d6bd0c7
&utmip=127.0.0.0
&utme=8(Account)9(testaccount-99999)11(2)
The Account key seems to be read correctly but the testaccount-99999 value appears as (A
Is some sort of weird truncation occurring here?
The gif request is not a supported or documented API. You can only use it with the javascript library provided or other google libraries that communicate with Google Analytics.
The good news is that Universal Analytics is a new update to Google Analytics (currently in Public Beta) and it has a documented protocol to send data to GA using server side code like you want.
Read more about it and how to get into the Beta here:
https://developers.google.com/analytics/devguides/collection/protocol/v1/

Resources