{"id":4128,"date":"2020-05-13T15:06:24","date_gmt":"2020-05-13T15:06:24","guid":{"rendered":"https:\/\/trackingchef.com\/?p=4128"},"modified":"2020-12-14T15:09:32","modified_gmt":"2020-12-14T12:09:32","slug":"adding-google-analytics-to-your-site","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/google-analytics\/adding-google-analytics-to-your-site\/","title":{"rendered":"Adding Google Analytics to your site"},"content":{"rendered":"\n

There are multiple ways in which you can add the Google Analytics (GA) tracking code to your site.<\/p>\n\n\n\n

Standard CMS<\/h2>\n\n\n\n

About half of the Top 1M websites use a CMS (Content Management System) of some sort (BuiltWith<\/a>), such as WordPress, Wix, Shopify etc.<\/p>\n\n\n\n

Since Google Analytics is the most widely adopted web analytics tool (67% of Top 1M<\/a>), almost every modern CMS has either a built in feature for GA or multiple plugins to support the standard GA implementation.<\/p>\n\n\n\n

If you have a standard implementation (i.e. no custom events or dimensions), you should probably stick to this solution.<\/p>\n\n\n\n

I’ve added a quick walkthrough of the most popular platforms: WordPress, Wix & Shopify.<\/p>\n\n\n\n

WordPress<\/h3>\n\n\n\n

If you’re using WordPress, the world’s most popular CMS, you have several available plugins for adding GA to your site.<\/p>\n\n\n\n

Site Kit by Google<\/a><\/strong> (Free)<\/p>\n\n\n\n

This plugin, developed by Google, enables multiple Google tools for you website with one click: Google Analytics, Google Search Console and more. It can also be used to add the Google Tag Manager code to our site.<\/p>\n\n\n\n

\"\"
Source: Site Kit<\/a><\/figcaption><\/figure>\n\n\n\n

Monster Insights<\/a><\/strong> (Free, Pro plan available)<\/p>\n\n\n\n

This is by far the most popular GA plugin for WordPress (more than Google’s!) with over 2M active installations.<\/p>\n\n\n\n

Besides adding the GA code to the site, it also provides a neat analytics dashboard from directly inside your WordPress admin.<\/p>\n\n\n\n

\"\"
Source: MonsterInsights<\/a><\/figcaption><\/figure>\n\n\n\n

Wix<\/h3>\n\n\n\n

If you’re using Wix, then you can only add Google Analytics to sites with a connected domain (paid plan).<\/p>\n\n\n\n

  1. To connect GA to a Wix site, you will need to first grab your GA Tracking ID (learn how<\/a>)<\/li>
  2. In Wix, navigate to Marketing Integrations<\/a><\/li>
  3. Go to Google Analytics and click Connect<\/li>
  4. Click “Connect Google Analytics”<\/li>
  5. Paste in your Google Analytics ID<\/li>
  6. Optionally, you can check the IP Anonymization<\/strong> checkbox to ensure GA will not save your site visitors’ IP addresses<\/li>
  7. Click Save<\/li><\/ol>\n\n\n\n
    \"\"
    Adding Google Analytics to Wix<\/figcaption><\/figure>\n\n\n\n

    This will add the GA code to all pages on your site. If you have multiple domains on Wix, make sure you add it to your Primary domain.<\/p>\n\n\n\n

    Shopify<\/h3>\n\n\n\n

    Shopify store owners can add Google Analytics tracking on any plan. <\/p>\n\n\n\n

    1. To connect GA to a Shopify store, you will need to first grab your GA Tracking ID (learn how<\/a>)<\/li>
    2. Log into your Shopify admin<\/li>
    3. Navigate to Online store > Preferences<\/li>
    4. In the Google Analytics section, paste your GA Tracking ID<\/li>
    5. Click Save<\/li><\/ol>\n\n\n\n
      \"\"
      Adding Google Analytics to Shopify<\/figcaption><\/figure>\n\n\n\n

      Adding GA to your store will add the option to enable Enhanced Ecommerce tracking in GA. Enabling this tracking will reflect ecommerce data from your store in GA.<\/p>\n\n\n\n

      Using Google Tag Manager<\/h2>\n\n\n\n

      A recommended way to add GA, for more experienced users, is by using Google Tag Manager (GTM). With GTM, you can easily manage multiple analytics, advertising and other tags on your site. <\/p>\n\n\n\n

      Managing your tags via GTM provides several benefits:<\/p>\n\n\n\n

      1. No developer required – Marketers can quickly add\/remove tags from the website without changing code or waiting on the Dev team<\/li>
      2. Up to date snippets – GTM has standard tags for all major advertising and analytics platforms, that automatically update<\/li>
      3. Performance – Tag in GTM are loaded asynchronously, and most standard tags in GTM use a light version, saving plenty of Javascript overhead<\/li><\/ol>\n\n\n\n

        To add GA to your site using GTM, you will first need to install GTM on your site (guide coming soon!).<\/p>\n\n\n\n

        After you have the GTM tag on your site, you can follow these steps:<\/p>\n\n\n\n

        1. To connect GA using GTM, you will need to first grab your GA Tracking ID (learn how<\/a>)<\/li>
        2. Go to your GTM account and open the relevant container<\/li>
        3. Click “Add a new tag”<\/li>
        4. Name the tag something memorable, e.g. Google Analytics Pageview<\/li>
        5. Under Tag Configuration select Tag Type “Google Analytics: Universal Analytics”<\/li>
        6. Verify that the Track Type is “Pageview”<\/li>
        7. In the Google Analytics Settings dropdown select “New Variable”<\/li>
        8. Name the variable something memorable, e.g. Google Analytics Tracking ID<\/li>
        9. In the Tracking ID field paste your GA Tracking ID<\/li>
        10. Click Save<\/li>
        11. Back in the Tag, under Triggering, choose a new trigger. The default trigger is “All Pages”, which will load the GA tag on all website pages<\/li>
        12. Click Save
          <\/li><\/ol>\n\n\n\n

          Be sure to publish the changes in your GTM container by clicking Submit and then Publish<\/p><\/blockquote>\n\n\n\n

          \"\"
          Google Analytics variable in Google Tag Manager<\/figcaption><\/figure>\n\n\n\n
          \"\"
          Google Analytics tag in Google Tag Manager<\/figcaption><\/figure>\n\n\n\n

          Code Installation<\/h2>\n\n\n\n

          If you’re building a custom website, or just need a more flexible implementation of Google Analytics, you can simply install it using the provided Javascript snippet (where do I find this?<\/a>).<\/p>\n\n\n\n

          \"\"
          The Google Analytics Javascript snippet<\/figcaption><\/figure>\n\n\n\n

          To properly install GA, add the JS snippet on all pages of your website, preferably as high up as possible on the <head> tag. Adding GA in a the <body> tag will also work, but might result in discrepancies in tracking, as some users might leave the page before<\/strong> the GA snippet has fully loaded.<\/p>\n","protected":false},"excerpt":{"rendered":"

          There are multiple ways in which you can add the Google Analytics (GA) tracking code to your site.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[38],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4128"}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=4128"}],"version-history":[{"count":8,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4128\/revisions"}],"predecessor-version":[{"id":4819,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4128\/revisions\/4819"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=4128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=4128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=4128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}