Email Tracking is shown in wrong View - google-analytics

I've set up e-mail tracking following this manual:
https://developers.google.com/analytics/devguides/collection/protocol/v1/email
My tracking URL is valid and seems to work since it shows up in Google Analytics (Realtime->Events), but it is showing up in the wrong view.
My Google Analytics account has an 'account' with 12 'properties' which has 3 'views'. The tracked events only show up in the first view listed (which I use for a subdomain), my 'main' view for the root domain is the second one listed and the events are not tracked in this view.
I noticed these views have a 'view ID', but I can not find a parameter in the Measurement Protocol manual that allows me to set it:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
How can I switch the view in which my email tracking events are stored? Or perhaps enable the tracking in my other views as well?

Data is collected on the property level, that's why there is no parameter for the measurement protocol to set the view. Views merely filter and display the data from the property.
So the events should show up by default, if not you have probably some filter that excludes the data from those particular views (e.g. something like a hostname filter, since your measurement protocol calls won't have a hostname set).

Related

Implementing User-ID With Google Tag Manager

I have added Google Tag Manager to our site, and using the data layer inserted several custom dimensions, including 'user_id'
Data Layer with user_id shown
The Google Analytics variable in Tag Manager is configured to pass these data layer variables into the coresponding dimensions:
Tag Manager Variable & Dimensions in Analytics
I know this is working as I am able to add this as a secondary dimension in Analytics when viewing reports:
Analytics with Dimension Shown
However, the user view that is created when I have set up the User-Id isnt showing anything:
Creating the User View
We installed Tag Manager using the recommended steps:
Installation of Tag Manager
Do we also need to add the 'Global Site Tag Tracking Code'?
How to Implement the User-ID in your tracking code
If not, what am I doing wrong?
You're actually REALLY close. You actually don't need to create the custom dimension.
The correct way is to set the userId field in your GA tag (I did it through a GA variable so it is applied everywhere).
Yes, that is exactly correct (what #XTOTHEL answered above), but for those who are reading this, I found these two blog posts helpful (esp if you are using GTM):
GA UA: https://www.analyticsmania.com/post/google-analytics-user-id-with-google-tag-manager/
GA4: https://www.analyticsmania.com/post/google-analytics-4-user-id/
And of course, the GA docs: https://support.google.com/tagmanager/answer/4565987?hl=en

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).

Google Analytics - Segment/Filter View - Based on Custom Attribute

I am not sure of the best way to handle this, however I am sure it is possible to implement with Google Analytics.
I currently have 1 Google Analytics account with all the data.
I would like to create 3 additional "views" within Google Analytics to filter each part of my app accordingly.
The sections are:
the landing pages landing (sales pitch)
the application pages app (the product we offer)
the customer portal pages portal (the product we offer to our user which thier users view).
So dimensions/views (unsure of the terminology here) are;
landing app and portal.
Currently I am using code like the following;
function gtag() {
dataLayer.push(arguments)
}
window.dataLayer = window.dataLayer || [], gtag("js", new Date), gtag("config", "UA-XXXXXXXXX-1", {
custom_map: {
dimension1: "website_segment"
},
website_segment: "landing"
});
I was then expecting to see these values in;
View > Filters > Custom
However they don't exist.
Please note:
I do not wish to utilize separate GA accounts to achieve this.
I cannot utilize the URL scheme with regex to achieve this.
Custom Dimensions should be available in your list of fields when you're setting up a filter for your GA view.
It looks like you're sending info to GA with the code you provided, but have you defined the Custom Dimension in your GA settings? You'll need to do that as a first step.
Access Property > Custom Definitions > Custom Dimensions, add a custom dimension, and set the scope (you'll want a Hit scope for your use case). Then ensure your code is configured to send to the dimension you just created.
See https://support.google.com/analytics/answer/2709828#Lifecycle for an overview of Custom Dimensions - though it looks like the code snippets there are out-of-date, depending on which version of GA you're using.
As far as I understand your need, it absolutely seems feasible. You collect your data in one Analytics property, and you would like to create separate views for various site content, where content is identified by a custom dimension, instead of the page path.
First, make sure, you have enabled custom dimension 1 in your property settings. As you are collecting this data on hit level, you need to set the custom dimension to hit level as well.
Second, you need to deploy your code to send this data to Google Analytics. I assume, you can substitute the proper value (landing/app/portal) for the website_segment key. Please let me know, if this is also part of your question, how to assign the proper value to the defined custom dimension.
To check if data is sent, you can use Google Analytics Debugger Chrome extension, or you can inspect the call to www.google-analytics.com in developer console / Network tab, whether cd1 parameter is set.
To verify if data is available in Google Analytics, the easiest way is to open the Behavior / Content / All pages report, and to add your custom dimension as a secondary dimension for a period, which should already contain data.
Third, you need to create your new views and your filters within Google Analytics. Please note, that you won't see any available values here, but you can still select your custom dimension, and define a filter.

google analytics & google tag manager : Where to read the data

I had to integrate the GTM and track few data into a webpage and im facing some comprehsion issues. I dont think it's code wise, but i don't get where i'm supposed to see the data that im tracking.
i've successfully added the GTM code into my application and defined some data to be sent inside the dataLayer variable, after that i can go to the GTM admin panel and choose to Preview and Debug, so i can see the data i'm trying to track and everything seems allright. Therefore, i don't know what happens to them next. I don't know where i can see the data that i track, where they are stored. I've linked my GTM account to my GA account so i can see the traffic and other datas, but not the ones i've put inside my dataLayer object.
Anyone know what are the next steps ?
Here's some screenshots of my tag
Thanks
I think Simo Ohava - the GTM "god" - is explaining it quite well:
Datalayer Basics:
https://www.simoahava.com/analytics/data-layer/
Google Tag Manager & Datalayer:
https://www.simoahava.com/analytics/google-tag-manager-data-model/
As far as I understand you, all your questions (including basics and how to access via tag manager - and more) are pretty nice answered/explained there.
I've linked my GTM account to my GA account
What do you mean by this? Where did you "link" the data? GTM tracks data via the tags you define to fire for various interactions on the pages, including pageviews, events, and transactions (all known as "hits"). Each tag that fires in GTM has an associated Universal Analytics property ID that comes from your Google Analytics account. You must include this ID in all your tags. This is where you tell GTM tags to send your data and this is where in GA you will find the reports on your data.
Simply pushing data to the dataLayer does nothing unless
you're also pushing events to it and using those events to trigger tags to fire
You've defined GTM variables to grab the data being pushed in
Your tags are configure to pull that data into your reports
EDIT
To pull data into GTM from the dataLayer, you need to do the following:
Make sure your data is pushed in the following format:
datalayer.push({
'event': 'your event',
'page': 'custom/path/path',
'otherData': 'custom dimension1',
'otherData2': 'custom metric1'
})
Create a Data Layer variable, whose name can be anything, and whose value is the name of the dataLayer key.
Include the Data Layer variable's name in whatever tag you need the data to apply to. For example, if it's a custom dimension you need to associate to your pageview, then go into the Advanced Configuration of the tag and add the data into the Custom Dimension section (remember to configure your CD in GA, and to include the index). You can be associating any kind of data to the specific tag (eg. page path, page title, page name).
Test and then publish your tag!

How to track traffic by domain in Google Analytics?

I am using Google Analytics in an embedded form. This form will be placed on various websites, and I want to track the traffic with GA. Creating a new property in GA for each website that embeds the form is not an option. As such, I'm looking to track traffic from all the websites using one GA Tracking ID and segment the data by domain. However, I'm having trouble figuring out how to customize the GA code snippet to do that -- everything I find refers to the old classics GA code and not the new universal code. Can someone please help?
Thanks!
You do not need to customize the code, the domain is tracked automatically in GA in the "hostname" field. Go to your GA admin panel, set up a new view, create an "include" filter and set field to "hostname" and the value to the hostname that you want to track. Repeat for all your domains.
You can create up to 25 views per property.
If you do not need a permanent solution you can track everything to one view and create segments based on the value of the hostname field. Or even more ephemeral, set the secondary dimension to "hostname" in your data tables and use the filter in the upper right of the table to filter by value of the secondary dimension.
Google's official answer is here: https://support.google.com/analytics/answer/1012243?hl=en
by default GA is only showing URI, without hostname. You could follow above link, to add a filter to "include hostname in URI".
this video could be more instructive: https://www.youtube.com/watch?v=tcBg6QfgWR8

Resources