Google Analytics Glossary

Add Google Analytics to Magento

Image of Iron Brands

Published on Nov 23, 2023 and edited on May 7, 2024 by Iron Brands

Google Analytics can give you greate insight on user behavior and e-commerce performance. Thankfully, Magento makes it easy to add Google Analytics. Here is how to do it, step by step.

Let's dive in!

  1. Integrating Google Analytics
    1. Set up Google Analytics
    2. Adding Google Analytics
    3. Verify the Integration
    4. (Optional) Create New Properties
  2. Final Thoughts

Before we dig in you need to know that Google Analytics is complex and a bit clunky. There are other options that give you the same insights in a slick and straightforward dashboard.

Simple Analytics is one of them. A privacy-friendly and simple analytics tool - just the insights you need in a straightforward dashboard. (And its also free yes).

Can you spot the difference between the dashboards?

All right, now let's get into answering your question!

Integrating Google Analytics

Set up Google Analytics

  • Log into your GA profile (or create one, if you haven't already).
  • Create a GA property for your store.
  • Inspect the property and note down your Measurement ID. You will need it later.

Adding Google Analytics

  • Access your Magento store's backend by logging into the admin panel.
  • In the Magento admin panel, go to ‘Stores’ > ‘Configuration’.
  • Under ‘Configuration’, navigate to ‘Sales’ and then ‘Google API’. In Magento 2, this might be under ‘Sales’ > ‘Google API’ > ‘Google Analytics’.
  • Navigate to the ‘Google API’ settings:
  • Set ’Enable Google Analytics’ to ‘Yes’.
  • Enter Your GA Measurement ID** in the ‘Account Number’ field.
  • Save the Configuration.

Note: Magento uses the Universal Analytics code format (UA-XXXXX-Y). For GA4 integration, you might need to use a custom solution or extension, as the direct input of the ‘G-’ format Measurement ID might not be supported natively.

Verify the Integration

After configuring Google Analytics in Magento, check the real-time data in your GA dashboard to ensure that tracking is working correctly. You might also consider using browser tools like the Google Analytics Debugger for Chrome to verify the setup.

(Optional) Create New Properties

To track multiple stores, create more GA properties and use the corresponding Measurement IDs. This prevents GA from conflating the data.

Final Thoughts

Adding Google Analytics to your website can give you great insights. However, ask yourself: is Google Analytics the right tool for you?

GA is an overpowered solution for straightforward analytics. If you're looking for a simple and intuitive dashboard with the insights you need, there are better alternatives.

If this resonates with you, feel free to give Simple Analytics a spin. You just need to add the script to your app and off you go. This takes about one minute- and there is a free version as well!

Enjoy!