#GTMTips: Use product-wide custom dimensions in GA Firebase – News Couple
ANALYTICS

#GTMTips: Use product-wide custom dimensions in GA Firebase


Thanks to daring police action Yorn Riedel And Ahmed Maarouf, seems to be one of the biggest hurdles to making a complete migration from using old SDKs for Google Analytics and Google Tag Manager to the latest Tag Manager + Firebase SDK, and now it’s not an issue.

The problem, of course, is with the dimensions assigned to the product range or more specifically the lack of support for them. So far, I’ve been against recommending a migration to anyone with an enhanced ecommerce tracking setup simply because the documentation didn’t mention the ability to submit these custom definitions to Google Analytics.

But Jörn Riedel did what anyone who wanted to find the truth away from documentation should have done: He tested different ways to do it, and found the solution. Spoiler alert: It makes perfect sense.


X


Simmer . Newsletter

Subscribe to the Simmer newsletter to get the latest news and content from Simo Ahava right in your inbox!

Tip 93: Submit Product-wide Custom Dimensions with Firebase

Naturally, this only applies to “legacy” Firebase GTM Universal Analytics tags. Google Analytics for Firebase no longer has an Enhanced Ecommerce model. Also, thanks to the recent news about the upcoming discontinuation of Google Analytics for mobile apps, this tip is likely to be short-lived.

Anyway, the simple solution is to do what you would do with a stretch dataLayer Setup when working with Google Tag Manager Web Optimized Ecommerce: You fixed code Dimension and metrics indicators in the same item packages.

This is what the Swift (iOS) app will look like:

let product1: [String : Any]  = [
  AnalyticsParameterItemID: "sku1234",
  AnalyticsParameterItemName: "Donut Friday Scented T-Shirt",
  AnalyticsParameterItemCategory: "Apparel/Men/Shirts",
  AnalyticsParameterItemVariant: "Blue",
  AnalyticsParameterItemBrand: "Google",
  AnalyticsParameterPrice: 29.99,
  AnalyticsParameterCurrency: "USD",
  AnalyticsParameterQuantity: 1,
  "dimension4": "Product Scoped Value 01 - GTM Firebase"
]

And the same in Kotlin (Android):

val product1 = Bundle()
product1.putString(FirebaseAnalytics.Param.ITEM_ID, "sku1234")
product1.putString(FirebaseAnalytics.Param.ITEM_NAME, "Donut Friday Scented T-Shirt")
product1.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "Apparel/Men/Shirts")
product1.putString(FirebaseAnalytics.Param.ITEM_VARIANT, "Blue")
product1.putString(FirebaseAnalytics.Param.ITEM_BRAND, "Google")
product1.putDouble(FirebaseAnalyitcs.Param.PRICE, 29.99)
product1.putString(FirebaseAnalytics.Param.CURRENCY, "USD")
product1.putLong(FirebaseAnalytics.Param.QUANTITY, 1)
product1.putString("dimension4", "Product Scoped Value 01 - GTM Firebase")

If done correctly (eg you have an activation tag in GTM that sends optimized e-commerce data to Google Analytics), you should see the custom component surface when querying that product with the e-commerce action it was submitted in.

GA . Product Report

A simple solution to a paradoxical problem. Thank you Yorn and Ahmed for the police work!



Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button