Campaign Trackig : Field to set data in google tag manager - google-analytics

Campaign Tracking
I have created a URL variable with Component type as Query and Query key as source. I have created Tag that fires on all page in the TAG i have enable field to set option
Fields to set
Field Name Value
campaignSource {{source_utm}} were source_utm is URL variable that I have created.
TAG is getting fired and data is getting populated. In the debug mode following data is reflecting
Filed to set {campaignSource: '123'}
URL is like this : www.xyz.com/?source=123
My Query were would I will be able to see the campaign data in GA as i am not able see the data in campaign report. Also would like to know how long it take for campaign data to get populate in GA.This are the only steps I have followed do I need to follow more other steps also .Also I would like to know how can I access Field to set data in Google Analytics report. Please advice thanks

Related

Send User ID from Google Tag Manager to Google Analytics 4

I have set up google tag manager with my GA4 property
(NOT legacy Universal Analytics)
according to the official guide:
https://support.google.com/tagmanager/answer/6103696?hl=en&ref_topic=3441530#zippy=%2Cweb-pages
and I have figured out how to send custom/recommended events to GA4 using
dataLayer.push({}) objects, using their "event" field in triggers and tags,
based on a Universal Analytics guide
(https://www.analyticsmania.com/post/track-logins-with-google-tag-manager/),
because this appears to be a black hole in the official guide:
https://support.google.com/tagmanager/answer/9442095
only describes, briefly, the GTM-side of the story.
Same goes for sending User ID: the docs only tell
when creating a Google Analytics 4 Configuration tag:
To set a user ID, add a row to Fields to Set.
Set the Field Name to user_id, and the Value to
a Tag Manager Variable that returns the user ID.
and I only take the knowledge from the external UA guides
to use a Data Layer Variable that reads the user_id field from the dataLayer,
and also create a corresponding user_id User Property on Google Analytics,
which in Universal Analytics used to
have related settings that don't exist anymore
(https://www.analyticsmania.com/post/google-analytics-user-id-with-google-tag-manager/).
So I have deployed my GA4 Events with the user_id data layer variable
referenced in their Configuration (and it is visible on the datalayer in Debug View),
created the corresponding User Property in GA, and enabled User-ID reporting.
Yet, in my real-time view, the user_id fields always get some weird "gtm.js" value
(as if my data layer variable value was replaced by the event name
from the default dataLayer.push({event:"gtm.js",user_id:"ignored value")).
What in the world is missing for my user_id field to be recognised?
Thanks!
Thanks #bpstrngr! Was going around in circles for a while before finding your answer.
To clarify the step by step in case anyone else bumps into this;
When sending userId in dataLayer add an event name:
window.dataLayer.push({
'userId' : '{{ myUserId }}',
'event': 'userIdSet',
})
In GTM, create a Custom Event trigger that listens to that event (set event name equal to whatever event you wrote in step 1):
Add this event as a firing trigger into your tag:
So at long last it turned out,
that since the configuration tag was fired by the Page View event,
that happened before I pushed the user_id to the dataLayer,
so it filled the non-existing value with the event name instead.
I gave the user_id event a name to create a custom event trigger,
that re-triggers the configuration tag.
This way the user_id-s are finally visible.

user_id as custom dimension not passing to GA

I've created a custom dimension to pass the user-_id (a shopify customer id) to a custom report in GA, however it's not populating. Steps I've taken:
1. Defined custom dimension in GA called "User ID" with scope User
2. Configured in Tag Manager in page view tag, a new variable to capture the user_id from the data layer.
Following is a screenshot from the Tag manager assistant:
Creating a custom report with this new dimension and other metrics
Any idea why it's not passing the data?
You have to send the value to Google Analytics as custom dimension.
So, you have to add the index of the custom dimension and its value in 'Custom Dimensions' field in the Google Analytics tags or its shared settings variable:

Report last login by user on Google Analytics

What would be the easiest way to get a report on Google Analytics containing authenticated users ordered by the last login time (the latest login first)?
We are already using Event logging with Category "User", Action "Login" and Label set to user ID (a GUID). Is it possible to base the report on this data?
UPDATE 5-Dec-2018:
As a reference, we have a Custom Report for top logins:
This shows:
Now, I would like to change 'Hits' to "the last time the event occurred", with the given Event Label.
You can create a custom report with the event label ordered by date and time. Though the default implementation in GA only gives you up to the hours I believe. If you want more granularity, I think you'd need to create a custom dimension with a timestamp to the second/millisecond and capture that data front-end.

How to extract the specific AdWord keyword that a client clicked on?

I'm using AdWords to help generate form submissions, and a form submission is my heuristic for a conversion.
I want to fetch the specific AdWords keyword that generated a conversion and submit it along with the form so that I can track which keyword are generating which submissions. Is this possible?
I don't see an cookie that relates to a Google Ad click, and the automatically appended gclid only contains a timestamp when decoded.
If you are using autotagging in Adwords then you will not get the keyword in realtime to send it along with the form.
You would either need to use manual tagging, and extract the value from the utm_term parameter, or configure valuetrack parameters to have the keyword/matchtype in your destinantion url.
In both cases you'd need to store the value from the query parameter (e.g. in a cookie), read it in the page with the form and append a hidden form field to your form that is set to the proper value.

Get google analytics id from the code embed?

As an example, the code I have to embed has an ID of the form: UA-3235632-1, but to use the data export API I need the ID from the URL of the proper page, in this case: 6270018.
How do I get the real ID from the UA type ID?
That feature of the the GA Data Export API could indeed be a little more clear.
Here's what you need to do:
login to the GA Browser and in the
upper-right-hand corner drop-down
menu, select your GA Account of
interest (assuming you have more
than one--if you don't then you are
already on right page). The page
that renders will be the Website
Profiles for that Account. Find the
row in that table that corresponds
to the Profile (Report) you want
retrieve data from and click on the
next-to-last column Edit;
The page you'll see now will say
Profile Settings in the upper
left-hand corner. Just under that,
in smaller font, you'll see Profile
ID followed by a string of digits
(probably six to eight). This is what you want
(in the python client for the GA
Data Export API, it is referred to
as TABLE_ID)).
To retrieve this parameter (TABLE_ID) programmatically, the GA Data Export API Account Feed returns this value to you in the dxp:tableID field. In particular, an Account Query will return the list of profiles under that Account to which you have access; each Profile will have a tableID in the field i mentioned just above.

Resources