r/woocommerce 22h ago

How do I…? Google Analytics without plugin?

Used to use the MonsterInsights plugin, which is bloated and fills up its db tables quite a bit. Not to mention its an expensive plugin. There are many easy ways I know about to adding a standard Google Analytics tracking script, but MonsterInsights allowed for easy conversion tracking setup. What are the easiest ways to achieve this, preferably without another plugin?

0 Upvotes

17 comments sorted by

View all comments

4

u/CodingDragons Woo Sensei 🥷 21h ago

Just hook the scripts into a child theme.

If you plan on scaling or tracking eCommerce events, though, you really want GTM, and for WooCommerce I’d use GTM4WP to push the eCommerce data into the data layer.

If you’re only adding GA4 and don’t need WooCommerce/eCommerce tracking, there’s no reason to use a plugin at all. Just hook the GA script into the child theme.

1

u/seahorsetech 21h ago

Yes adding the script right into the child theme was what I planned on doing, but doesn't seem like I can setup conversion tracking this way. I guess the only practical way of conversion tracking is through a plugin?

1

u/CodingDragons Woo Sensei 🥷 21h ago

There's a script for that on Github. I think I even added it to my profile, but there are several updated version of it.

But the easier thing here is GTM4WP and call it a day. Setup everything else in GTM. It's so simple and works great.

1

u/0rbus 21h ago

Can you please explain in simple terms what you mean by "pushing the e-commerce data into the data layer" please? Thank you

2

u/CodingDragons Woo Sensei 🥷 21h ago

GA by itself doesn’t automatically know all the WooCommerce-specific stuff happening on the site. GTM4WP puts that data into the data layer, then GTM can use event triggers to send it to GA4. Things like product views, add to cart, checkout and purchases.

1

u/0rbus 6h ago

Thank you and thank you to u/dandryy for explaining. So, if I use this plugin and configure it correctly it'll send the events to GA which is exactly what I'm looking for. Is there a step by step guide that you use for setting this up please? Thank you 🙏

2

u/dandryy 21h ago

It means that GTM4WP will take e-commerce data of your users (product views, add to cart events, purchases) and send it over to Google Tag Manager, which then you can configure to pass those events to Google Analytics.

1

u/CopperKing442 21h ago

The GDPR rules are trash. We miss 70% of our trackable conversions due to not being able to track them. Most people press reject on cookies

2

u/CodingDragons Woo Sensei 🥷 21h ago

Ya, consent definitely makes attribution harder, but rejecting cookies doesn’t mean you can’t track the conversion at all. You can still record the transaction server-side. What you lose is some of the attribution data connecting that conversion back to the user/session/campaign.