How to Add Google Analytics to Magento Ecommerce Website

Here are the steps to add Google Analytics to Magento Ecommerce Website

How to Add Google Analytics to Magento Website


1. Sign up with a Google Account : First you need to visit Google Analytics. You’ll see a screen as shown below. Sign in with your Google Account, which you use to access GMail, YouTube, Google Drive and other Google Services. If you don’t have one, you need to create a google account and then sign in.

how to add google analytics to magento store

2. Sign up for Google Analytics : After signing into your Google Account, you’ll be taken to the following page where you need to Sign up for Google Analytics by clicking the Sign Up button.

how to install google analytics on magento ecommerce website store

3. Add Magento website information : Next you need to select whether you’re setting up Google Analytics for a website or a mobile app. Choose website. Also, you need to provide basic information about your Magento Ecommerce website such as URL, website name.

If you’re setting up Google Analytics for the first time, you’ll also need to provide an account name (Google Analytics profile for your website), reporting country & timezone. You’ll also see a set of checkboxes for data sharing settings. You can leave them as they are.

integrate google analytics to magento website

4. Get Google Analytics Tracking Code : After you fill the form, click Get Tracking ID button to generate the tracking code for your Magento Ecommerce website. You’ll see a popup for Google Analytics Terms & Conditions that you need to agree by clicking I Agree button.

google analytics tracking code for magento ecommerce store

5. Copy Google Analytics Account Number  : After you agree to the Terms & Conditions, you’ll be taken to the page where you’ll be provided the Google Analytics Tracking Code for your Magento Ecommerce Website. You don’t need to copy the entire HTML code. Just copy the Google Analytics Account Number under the section Tracking ID . It will be of the form UA-XXXXXXX-Y (UA-64248213-1 in the example below)

add google analytics tracking code for magento ecommerce website

6. Add Google Analytics Account Number to Magento : Next open your Magento Website’s Admin Area and navigate to System -> Configuration -> Sales -> Google API. Expand the Google Analytics Section and Select Yes from the dropdown labeled Enable. Next paste the copied Google Analytics Account Number in the textbox labeled Account Number. Click Save Config to save the settings. That’s it!

google analytics api settings in magento store admin

7. View Google Analytics Dashboard : After you’ve finished installing Google Analytics on your Magento Ecommerce website, allow 24-48 hours for Google Analytics to collect & analyze data about your site. Now, when you log into Google Analytics, you’ll be taken to the Google Analytics Dashboard that shows daily traffic stats about your website.

magento google analytics dashboard reporting tab

You can do a lot of cool stuff with Google Analytics such as track sign ups, sales, clicks by setting up Google Analytics Goals for your website. You can also track custom events by setting up event tracking in Google Analytics or adding custom dimensions for Google Analytics.



1. When you add Google Analytics to Magento Ecommerce Store, use your own Google Account. Don’t allow anyone else such as web developers, designers, web hosts or SEOs to use their Google Account. Each Google Analytics Account is tied to a Google account. If you decide to part ways, they may walk away with all the data and you’ll have start afresh.

2. How to know if your Google Analytics is working ? After you log into Google Analytics, click on Admin button at the bottom left corner of your screen. This will take you to the Admin page. Click Tracking Code under Tracking Info Menu.

how to know if google analytics is working on magento

You’ll be taken to a page which will display the Status as Receiving traffic for past 48 hours

google analytics tracking status for magento ecommerce store

Also, check out our list of Best Web Analytics Tools to understand visitor behavior and grow your business.