How to Set Up Webmasters, Google Analytics, Conversion Tracking & Sitemaps

Article sections

    Setting Up a Google Analytics Account

    1. Go to https://www.google.co.uk/analytics/
    2. Sign in with admin email
    3. Click Google Analytics
    4. Click Admin
    5. Click on the Account drop-down >> Create New Account
    6. Enter the company name in Account Name and Website Name
    7. Enter the domain name into Website URL
    8. Untick all the boxes
    9. Click Get Tracking ID
    10. Click I Accept
    11. Click the back arrow
    12. Click User Management
    13. Add permissions for admin email
    14. Click the Read and Analyse dropdown and Tick All boxes
    15. Add permissions for client email
    16. Click the Read and Analyse dropdown and Tick All boxes
    17. Click Add

    Installing Analytics

    Installing on Magento 1.9

    1. Getting the Tracking Code
      1. Go to https://analytics.google.com/
      2. Sign in with admin email
      3. Click Google Analytics
      4. Click Company Name >> All website Data
      5. Click Admin
      6. Click Tracking Info >> Tracking Code
      7. Select the text in the Website tracking box and copy
    2. Adding to Magento 1.9
      1. Login to Magneto backend
      2. Go to System >> Configuration
      3. Click General >> Design >> HTML Head
      4. In the Miscellaneous Scripts paste the website tracking code
      5. Click Save Config

    Installing on WordPress

    1. Getting the Tracking Code
      1. Go to https://analytics.google.com/
      2. Sign in with admin email
      3. Click Google Analytics
      4. Click Company Name >> All website Data
      5. Click Admin
      6. Click Tracking Info >> Tracking Code
      7. Select the text in the Website tracking box and copy
    2. Adding to WordPress
      1. Go to https://domain.com/wp-admin and login
      2. Go to Plugins >> Add New
      3. Search Insert Headers and Footers
      4. Click Install Now
      5. Click Activate
      6. Go to Settings >> Insert Headers and Footers
      7. Paste the Website tracking code in the Scripts in Header
      8. Click Save

    Setting up Webmasters Tools

    1. Go to https://www.google.com/webmasters/
    2. Sign in with admin email
    3. Add Property
      1. Add Property
        1. Click Search Console
        2. Click Add Property
        3. Enter Domain Name
        4. Click Add
        5. Choose Google Analytics (you may have to click Alternate Methods)
        6. Click Verify
        7. Click Continue
      2. Location Targeting (only applicable to non-country specific domain names e.g. .com and not .co.uk as they are automatically targeted to the domains country)
        1. Click on the Cog >> Site Settings
        2. Click Search Traffic >> International Targeting
        3. Click Country
        4. Tick the box
        5. Choose the target country from the drop-down
        6. Click Save
    4. Repeat the “Add Property” steps for http://domain.com, http://www.domain.com, https://domain.com, https://www.domain.com
    5. Choose Preferred domain
      1. Click Search Console
      2. Choose one of the domains you have just added
      3. Click on the Cog >> Site Settings
      4. For Preferred domain choose a base domain (We like to use https://domain.com)
      5. Click Save

    Linking Webmasters to Google Analytics

    1. Go to https://www.google.co.uk/analytics/
    2. Sign in with admin email
    3. Click Google Analytics
    4. Click Company Name >> All Website Data
    5. Click Acquisition >> Search Console >> Queries
    6. Click Set Up Search Console Data Sharing
    7. Click Adjust Search Console
    8. Click Add
    9. A new window will open, select the domain name you would like to use (normally the one without the www.), it should say This site is not linked to any property in your Google Analytics account
    10. Click Save >> Ok

    Conversion Tracking Setup

    Ecommerce Purchase Tracking

    1. Go to https://analytics.google.com
    2. Sign in with admin email
    3. Click Company Name >> All Website Data
    4. Click Admin
    5. Click View Settings
    6. Change Currency displayed as to British Pounds (GBP £)
    7. Click Save
    8. Click Admin
    9. Click Tracking Info >> Referral Exclusion List
    10. Click + ADD REFERRAL EXCLUSION
    11. In Domain type worldpay.com
    12. Click Create
    13. Click + ADD REFERRAL EXCLUSION again
    14. In Domain type paypal.com
    15. Click Create
    16. Click Admin
    17. Click E-Commerce Settings
    18. Set Status to On
    19. Set Related Products to On
    20. Click Next Step
    21. Set Enable Enhanced Ecommerce Reporting to On
    22. Click Submit

    Contact Form Tracking for Magento 1.9

    1. Go to https://analytics.google.com
    2. Sign in with admin email
    3. Go to Company Name >> All Website Data 
    4. Click Admin
    5. Click Goals
    6. Click +NEW GOAL
    7. Click Custom
    8. Click Continue
    9. Fill out the following sections;
      1. Name – Contact Form
      2. Type – Destination
    10. Click Continue
    11. Set Destination to Equal to /contacts/index/
    12. Click Save

    Setting Up Google Tag  Manager

    Added: 22/03/18

    Refer to this document for updates on Google Tag Manager.

    On creating this document the latest update was 16/03/18

    Useful tools/information for Google Tag Manager:

    Required/Useful tools for Google Tag Manager:

    Notes:

    • Remove remnants of old analytics
    • Verify in search console with other method

    Setting Up Google Tag Manager

    Creating New Account

      1. Go to https://tagmanager.google.com
      2. Sign in with admin email
      3. In the top left click create account
      4. Enter the company name under account name & click continue
      5. Under container name enter website: www.examplesite.co.uk
      6. Click “Web” under “Where to use container” box
      7. Click create

    Installing Software

      1. After the account is created, a window is opened with 2 sets of code
        1. Insert top box of code into the header
        2. Insert the bottom box of code into the footer
        3. Make sure you save these!
        4. Go back to the Google Tag Manager Dashboard
        5. Click the blue submit button in the top right
        6. Go ahead and click publish then click continue
      2. If using Magento insert Google Analytics Code in Google API section on the backend & Tag Manager Code in applicable area.
      3. To test whether the code is working do the following
        1. Go to the site you are working on
        2. On the top right where your extensions are click on Google Tag Assistant
        3. Once the window opens click enable in the bottom left of the window
        4. Once you have enabled Google Tag Assistant, refresh the page
        5. Now there should be a number 1, indicating that you have 1 Google Code active on the site
          1. Make sure the box is green, if yellow make sure you have submitted the container (Follow step 1)
          2. To find your Tag Manager code, go to the dashboard and look to the left of the preview button

    Setting up Tracking

    Setup needed variables for all tracking items

        1. On the left hand side of the screen go to the Variables Tab
        2. Click configure button at the top of the screen
        3. Enable all items under Clicks & Forms

    Page view tracking

        1. Go to the Tags Tab
        2. Click new and change the name in the top left box to “Page View”
        3. Click Tag Configuration box & chose the Universal Analytics tag type
        4. Leave track type as Pageview
        5. Click Google Analytics Settings box and in the drop down select “New Variable”
        6. Get your Google Analytics tracking code and use this for the name and also insert the code into the “Tracking ID” box
        7. Click save and you will be returned to the previous page
        8. Click the box that is called triggering & select “All Pages” trigger
        9. Submit & Publish the container
        10. Test whether the code is working
          1. Go to the site and refresh the page
          2. The Tag Manager Assistant will now show blue & have your Tag Manager & Analytics Code shown
          3. Go to Google Analytics real time view and see the page views – Go to a few different pages to test

    Email & Phone Tracking

        1. Create new Tag and name either Email/Phone Tracking
          1. Phones Only – If you have more than 1 number name it Landline/Mobile or Landline – (number after area code)
        2. Choose your tag to be Universal Analytics & change track type to “Event” & Open Google Analytics and setup your goals using the same details you use below so you duplicate both
        3. Change the following details
          1. Category – Contact
          2. Action –
            1. Phone Only – Landline/Mobile Call (name same as tag)
            2. Email Only – Email
          3. Label – Leave empty
          4. Value – Leave empty
          5. Non-Interaction Hit – True
          6. Google Analytics Setting – Choose Analytics code from earlier
        4. Click the Trigger box and create a new trigger by clicking the + in the top right of the screen and change the following:
          1. Name –
            1. Phone Only – Landline (number after area code) Click
            2. Email Only –  Email Click
          2. Trigger configuration – Clicks then select “All Elements”
          3. Select the some clicks option
            1. Phones Only – copy the source code number and use these options: Click element – contains – tel:(Insert number)
            2. Email Only – copy source code email and use these options: Click element – contains – mailto:(client email)
          4. Submit & Publish the new container to update
        5. Test whether the changes have been applied
          1. Go to the site and refresh any page with applicable contact details
          2. Go to Google Analytics real time view and then to events last 30 minutes
          3. Click though your elements and they should show on screen

    Form Tracking

        1. Please refer to the following documents for form tracking:
          1. Contact Form 7
          2. Divi Forms
          3. Ninja Forms & Events
          4. 6 Types of Tracking Methods Google Tag Manager
        2. Remember to test & submit all of your containers

    (Old Method) Bird Marketings Form, Mailto & Tel Tracker

    Setting up Goals in Analytics

    1. Go to https://analytics.google.com
    2. Sign in with admin email
    3. Go to Company Name >> All Website Data 
    4. Click Admin
    5. Click Goals
    6. Click +NEW GOAL
    7. Click Custom
    8. Click Continue
    9. Fill out the following sections;
      1. Name – Call (change to “Form” or “Email” depending on what you want to track)
      2. Type – Event
    10. Click Continue
    11. Fill out the following sections;
      1. Category – Contact
      2. Action – Call (change to “Form” or “Email” depending on what you want to track)
      3. Label – LEAVE BLANK
      4. Value – LEAVE BLANK
    12. Click Save
    13. Repeat steps to add any other form of tracking you need

    Adding to Magento 1.9

    1. Login to Magneto backend
    2. Go to System >> Configuration
    3. Click General >> Design >> Footer
    4. In the Miscellaneous HTML box add the relevant tracking codes listed below
    5. Click Save Config

    Adding to WordPress

    1. Go to https://domain.com/wp-admin and login
    2. Go to Plugins >> Add New
    3. Search Insert Headers and Footers
    4. Click Install Now
    5. Click Activate
    6. Go to Settings >> Insert Headers and Footers
    7. In the Scripts in Footer box enter the following code:
    8. Click Save

    Tracking Codes

    Prerequisites
    • jQuery 1.6+
    • gtag.js included in header (<head>)
    Main Code:

    <script src="https://birdmarketing.s3.amazonaws.com/trackers.js"></script>

    Call Tracking Code:
    <script>
    BM.addTracker({
      type: 'phone',
      phone: ['01277286565', '01234567890'], //Change this to the phone number you want to track
      callback: function(phone) {
        gtag('event', 'Call', {event_category: 'Contact', event_label: phone});
      }
    });
    </script>

    Make sure you change 01234567890 to the phone number you want to track and ensure you have setup the analytic goals for this tracking code.

    Email Tracking:
    <script>
    BM.addTracker({
      type: 'email',
      email: ['email@example.com', 'sales@example.com'], //Change this to the email you want to track
      callback: function(email) {
        gtag('event', 'Email', {event_category: 'Contact', event_label: email});
      }
    });
    </script>

    Make sure you change email@example.com to the email you want to track and ensure you have setup the analytic goals for this tracking code.

    Form Tracking:
    HTML Form
    <script>
    BM.addTracker({
      type: 'event',
      event: 'submit',
      selector: '#form_id', // change this for the form ID that you want to track (prefix with hashtag)
      callback: function() {
        var email = document.getElementById('email_id').value; // change this to the ID of your HTML form email input (don't include hashtag)
        gtag('event', 'Form', {event_category: 'Contact', event_label: email});
      }
    });
    </script>

    Make sure you have setup the analytic goals for this tracking code.

    Gravity Forms
    <script>
    BM.addTracker({
      type: 'event',
      event: 'submit',
      selector: '#gform_1', // change this for the form ID that you want to track (prefix with hashtag)
      callback: function() {
        var email = document.getElementById('input_1_5').value; // change this to the ID of your HTML form email input (don't include hashtag)
        gtag('event', 'Form', {event_category: 'Contact', event_label: email});
      }
    });
    </script>

    Make sure you have setup the analytic goals for this tracking code.

    Ninja Forms:
    <script>
    BM.addTracker({
      type: 'click',
      selector: '#nf-field-4', // change this to the ID of the Ninja Form submit button (prefix with hashtag)
      callback: function() {
        var email = document.getElementById('nf-field-2').value; // change this to the ID of your Ninja Form's email input (don't include hashtag)
        gtag('event', 'Form', {event_category: 'Contact', event_label: email});
      }
    });
    </script>

    Make sure you have setup the analytic goals for this tracking code.

    Contact Form 7
    <script>
    BM.addTracker({
      type: 'event',
      event: 'wpcf7mailsent',
      selector: '#wpcf7-f4-p9-o1', // change this to the ID of the CF7 form (prefix with hashtag)
      callback: function(event) {
        var inputs = event.detail.inputs;
        var email = undefined;
    
        for(var i = 0; i < inputs.length; i++) {
          var input = inputs[i];
          if(input.name.toLowerCase().indexOf('email') !== -1) {
            email = input.value;
            break;
          }
        }
        gtag('event', 'Form', {event_category: 'Contact', event_label: email});
      }
    });
    </script>

    Make sure you have setup the analytic goals for this tracking code.

    Postrequisites
    • Flush Cache

    Generate Sitemap

    Generate WordPress Sitemap

    1. Go to https://domain.com/wp-admin and login
    2. Go to Plugins >> Add New
    3. Search Google XML Sitemaps
    4. Click Install Now
    5. Click Activate

    Generate Magento 1.9 Sitemap

    1. Go to Magento Admin URL
    2. Sign in
    3. Go to Catalog >> Google Sitemap
    4. Click Add Sitemap
    5. In Filename type sitemap.xml
    6. In Path type /
    7. Click Save & Generate

    Submitting Sitemap

    1. Go to https://www.google.com/webmasters/
    2. Sign in with admin email
    3. Click on the relevant domain
    4. Go to Crawl >> Sitemaps
    5. Click Add/Test Sitemap
    6. Type sitemap.xml
    7. Click Submit
    in SEO