Zaraz eCommerce integration custom dimensions?

When setting up the GA tool in Zaraz, I can set up Custom Dimensions as fields so I assume values I pass in the data layer would then get passed onto GA as Custom Dimensions. But I don’t see any support for Custom Metrics? How do you set up GA Custom Metrics to get reported to GA when the events fire?

Hi @kendallb, Zaraz Google Analytics Universal is currently not supporting custom metrics. And honestly, I doubt we will add it as GA3 is sunsetting, which means all customers should slowly shift to GA4.

I have not yet dug into GA4, but if they do not support custom metrics, is it all part of custom dimensions now in GA4? Always seemed odd to have both IMHO.

Anyway we are in the process of migrating to GA4 but the first step is to get Zaraz going to make the migration easier. Hence the reason I am working on this. My goal was to first get GA3 working with Zaraz and the migrate to GA4. I know it’s being sunsetted in like 10 months, but folks are still using it at the moment so IMHO it would be nice to properly support it as a good migration path?

As you probably now, with GA4 there is no history import, so if you want to see any prior history you have to go and see it in your old GA3 properties. So our transition plan is to get GA4 running side by side with GA3 and if I can just send my data to Zaraz and simply activate both GA3 and GA4 it in Zaraz it makes my life a whole lot simpler. Because having both GA3 and GA4 active at the same time is not going to be very easy (stupid GA3 hit callbacks so you do not lose data on page loads).

So ideally if there are things that could be ‘translated’ somehow in the sending of data to GA3 so that it would also work with GA4, that would be preferable. Clearly if we want both GA3 and GA4 side by side using Zaraz, we need a way to send all the necessary data to GA3.

On the other hand we currently send the metrics only at order conversion and we have done that via a server side push for years as the javascript ones would always lose data (ad blockers etc blocking GA from loading). I am planning to try using Zaraz for conversion data once we are fully on GA4 as we should not have that issue anymore as the browsers will never block a script coming from our own domain :slight_smile: But that said, we could continue to send the problematic data to GA3 server side but I would need a way to ensure GA3 does not send purchase conversions over. Or we send it all server side for GA3 and GA4 until it’s sunsetted and deal with getting rid of that once we are only using GA3.

@yair-dovrat it turns out the lack of custom metrics in the GA3 implementation is a serious problem for us to get migrated over to GA4. We have information we need to push over to GA3 in those fields, which for GA4 will also likely end up in custom metrics (which they do support BTW, just differently). The caveat is that Zaraz is an all or nothing deal since it does all the purchase conversions. If I want to wire up purchase conversions with GA4 via Zaraz (or other tools like Facebook etc) then I have to do the purchase conversion zaraz.ecommerce() call. But that does not allow me to pass the custom metrics, which means we are now dead in the water getting that data into the existing GA3 properties while we migrate.

I suspect adding support for the custom metrics would be really simple as there is already full support for custom dimensions, so rather than cd1, cd2, cd3 etc they are cm1, cm2, cm3 etc. If we can get that added it means we can add support for pushing that data via Zaraz to GA3 and we can finally move forward on enabling GA4 via Zaraz.

Also right now we do our purchase conversions to GA via a server side push (not in the browser) as we push sensitive information over to it like cost price and gross margin etc. So when I set up Zaraz to do the ecommerce call for the ‘Order Completed’ so we can convert correctly for other tools (Facebook etc) then I get two conversions in GA. I suspect they de-dupe those, but one of them will get lost.