Google Universal Analytics Custom Metrics

ani2012
New Member
ani2012

How to pass google analytics custom metrics using Tealium data layer from page. As per my understaing this should also pass with utag_data or utag.link/view

 

ex:

 

<body>
<script type="text/javascript">
var utag_data={
site_region:"USA",
site_currency:"USD",

metric1: "1"  // defined as Integer - counter of 1 with every page load or event

metric2: "20.1" // defined as currency
};
</script>

 

 

11 REPLIES 11

Google Universal Analytics Custom Metrics

Paul
New Member
Paul

Hi @ani2012. I was wondering the same thing. I found this post in search.

 

https://community.tealiumiq.com/t5/Analytics-and-Data/How-to-pass-custom-variables-using-google-univ...

 

Hope it helps.

Google Universal Analytics Custom Metrics

Tealium Employee

Hi,

 

With the example you have posted, you would simply need to map "metric1" to metric 1 and "metric2" to metric2 using the mapping toolbox in the tag.

 

Here's a brief explanation of the different "scope" options available when you use the GA mapping toolsbox:

 

  • "All Page Hits" will use the "set" command in GA, which will persist the dimension for the current hit and all subsequent hits on that page.

 

  • "pageview" will only set the dimension on "view" events at the hit level, and will not persist for the remaining hits on that page.

 

  • "link" will only be sent on utag.link events, and not on any other type of event.

 

  • "transaction" will only be sent on the hit level with the transaction event (which is sent automatically as long as order id is mapped).

 

  • All the other mapping options are for enhanced e-commerce, and will only get sent when that particular e-commerce action is triggered.

 

I hope this helps.

 

Thanks,

 

Craig.

Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Google Universal Analytics Custom Metrics

ani2012
New Member
ani2012

Thanks @craig_rouse.

 

How to pass custom dimensions with Google Analytics Event (click/mousedown). All custom dimension already available under utag_data with load page. Do i still need to pass those dimensions with click event in code or only map those dimensions with event type "link" in Tealium?

Google Universal Analytics Custom Metrics

loldenburg
Contributor
loldenburg
@craig_rouse:
""All Page Hits" will use the "set" command in GA, which will persist the dimension for the current hit and all subsequent hits on that page."

This is contradicting the official Tealium documentation:

"This parameter allows you to map a custom dimension based on event types. Selecting an option other than "All Page Hits (set)" will cause the mapping to only be applied for the selected event type." - see the official Tealium documentation: https://community.tealiumiq.com/t5/Tags/Google-Universal-Analytics-Tag-Advanced-Mapping/ta-p/11985 => So for me this means: "If I set "all Page Hits", I get the dimension set on any Hit. And that is a setting that MAKES SENSE, instead of having to map every UDO variable twice that is used for Events and Pageviews which is usually the case for 95% of the variables (Event Category, Action, Label are only set for Events, anything else can be both).

I don't know who thought up this "All Page Hits" meaning you mention here, but it should be renamed to "persist to all Hits on same page" or sth like that AND there needs to be a setting "Any Hit" because that's what we would need in almost all cases...

Google Universal Analytics Custom Metrics

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor
Agree, this is very misleading, and a massive pain...

i was going round in circles all day, till i came across this post...

i can't update a custom dimension on a utag.link hit because it is setup this way. I have to re-do all my udo vars to custom dimension to individual pagevew and link hits (doubling up in almost all cases).



Research your Experience | Improve and Evolve | Leave no one behind

Google Universal Analytics Custom Metrics

loldenburg
Contributor
loldenburg

@kathleen_jo Does Tealium bother correcting its documentation or making the wording in the GTAG GA Tag consistent with the Analytics.js GA Tag?

Or do we waste our time here trying to help improve the product? 

Google Universal Analytics Custom Metrics

loldenburg
Contributor
loldenburg
yes the more shocking is that I alerted this to support several months ago AND in the forum and everything stays as it is...

Google Universal Analytics Custom Metrics

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

i setup a product idea, it's easier to track progress on those. I have given updates to be made in the past and they have been acted upon. 

Suggest you vote up and if we can get others to do so, it will raise the urgency. 

Wondering if there is another solution to this in the mean time. a way to trick it into sending a an updated set command... 

 

Research your Experience | Improve and Evolve | Leave no one behind

Google Universal Analytics Custom Metrics

loldenburg
Contributor
loldenburg
well thanks, but this is a bug or a glaring error in the documentation or lack of consistency.
Should we raise product ideas for typos as well?

Google Universal Analytics Custom Metrics

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

OK, so after reverting a few versions and armed with the knowledge of what each event type actually reflects i can state as follows: 

      • You can have an UDO variable mapped to the same Custom dimension or custom metric with different event type settings. 
      • BUT - There is a trick to it. If you use the optional naming in both, it won't workwont work.PNGThe custome dimension update for link event type did not work

        If you use the optional naming in 'All hits' it will work for the link, but wont work for all pageskinda worked.jpgkinda worked - but not really

        So - you need to not use the optional naming at all for it to work in all circumstance. really worked.PNGGot there in the end

This means i didn't have to go through and re-map all my custom dimension or metric vars and have double setting for view and link instead of the 'All hits' . From an implemenation point it works, however documentation still needs to be updated and will try and get a fresh post up to sign post this.  

Research your Experience | Improve and Evolve | Leave no one behind

Google Universal Analytics Custom Metrics

Community Manager
Community Manager

@loldenburg wrote:
well thanks, but this is a bug or a glaring error in the documentation or lack of consistency.
Should we raise product ideas for typos as well?

Hi @loldenburg,

Thanks for your feedback. The mapping options can be confusing and we are now reviewing the documents. In the future, you can submit documentation feedback using the feedback form at the bottom of each documentation page:

Provide Feedback.jpg 

Kristen Meren
TLC Community Manager