Google Analytics Tutorial: How To Set Up Google Analytics for Your Website

0
437

Want to set up Google Analytics on your website? You’ve come to the right place! Everyone says Google Analytics is fantastic for understanding your visitors, website, and online biz. But how the heck do you get started with it?

Maybe you had a go at setting up Google Analytics, but couldn’t get it working properly with your site. Or maybe it all seems too hard to even begin!

Do you want to install Google Analytics in WordPress? Knowing how your audience interacts with your website is crucial for your success. The best way to know your audience is through your traffic stats, and this is what Google Analytics provide for FREE. In this article, we will share why Google Analytics is important, and how you can install Google Analytics in your WordPress blog (step by step).

Get started with Google Analytics today!

Google Analytics can seem hard at first. However, if you followed this tutorial then you’ve set up an Analytics account and linked it to your website. Google Analytics is tracking your visits and you’re well on your way to becoming an Analytics ninja. You are awesome!

After a couple of days, you’ll start to see some visits appear in your Google Analytics. But how do you make sense of it all? What can Google Analytics actually tell you about your visitors, site, and business?

Never fear, dear reader. I have answered these questions — and more — in another article!

Step 1: Sign into Google Analytics

Follow these steps to sign into Google Analytics and begin the setup process:

  1. Go to the Google Analytics website.
  2. Sign into Google Analytics.
  3. Sign into your Google Account.
  4. Begin the Analytics signup process.

Step 2: Enter your account details

Once you’ve clicked the Sign up button in the previous step, you’ll see a New Accountpage appear. Here’s where you enter the details of your Google Analytics account and website:

Here’s how to fill in this form:

  • Website / Mobile app: Google Analytics lets you track visits to your website, as well as usage of mobile apps. Since you want to track your website traffic, make sure Website is selected.
  • Account Name: This will usually be the name of your business. You can track several websites (known as properties in Analytics-speak) under one account, but in this tutorial you’ll just track one site.
  • Website Name: Enter the name of your website here.
  • Website URL: Enter the URL (web address) of your website’s homepage — for example, www.example.com. If your website uses HTTPS — which is usually a good idea — then click the button to the left of the URL text field and change http:// to https://.
  • Industry Category: This setting is optional. If you set it to your biz’s industry then it helps Google tailor their reports, communications and educational tools to your needs. It doesn’t affect your visitor tracking at all.
  • Reporting Time Zone: Pick your time zone to make sure the reports use the correct times for your location.
  • Data Sharing Settings: These settings control what Google does with your Google Analytics data. They’re all selected by default, but feel free to deselect any of them. You can always turn them on again later.

When you’ve entered all your details and reviewed your data sharing settings, scroll down and click the Get Tracking ID button:

Step 3: Insert the tracking code in your website

Once you’ve agreed to the terms, Google Analytics takes you to the Tracking Codeadmin page for your property (website):

There are two important things on this page:

  • Your Tracking ID: This is a unique string of text that identifies your Google Analytics account and website. In the screenshot above it’s UA-XXXXXXXX-1, but your Tracking ID will contain digits instead of the Xs.
  • Your tracking code: This is the code in the box under Website tracking. It’s a snippet of JavaScript code that you need to insert into every page of your website, so that Google Analytics can track your visits.

Here’s how to insert the tracking code on your WordPress site, as well as on other types of site:

Follow these steps to install the plugin and insert your tracking code:

  1. Log into your WordPress admin.
    Open a new browser tab. Visit your WordPress admin URL, enter your admin username and password, and click Log In.
  2. Search for the GA Google Analytics plugin.
    In the left-hand admin menu, choose Plugins > Add New. In the Search Plugins box at the top right of the page, type ga google analytics and press Return.
  3. Install the plugin.
    Find GA Google Analytics in the search results, and click Install Now to install the plugin:
    wordpress-install-ga-google-analytics-plugin
  4. Activate the plugin.
    After a short while, the Install Now button should change to say Activate. Click the button to activate the plugin. In a few seconds, you’ll see the message Plugin activated appear at the top of the page.
  5. View the settings page.
    In the left-hand menu, choose Settings > Google Analytics to display the plugin’s settings page:
  6. Display the settings.
    Click the Plugin Settings header in the settings page. It expands to reveal the settings
  7. Enter your Tracking ID.
    Switch to your Google Analytics browser tab again. Select your Tracking ID in the Google Analytics Tracking Code admin page that you kept open earlier. Choose Edit > Copy to copy the Tracking ID, then switch back to your WordPress browser tab and click the box next to GA Property ID. Choose Edit > Paste to paste your Tracking ID into the box
  8. Enable Analytics and Universal Analytics.
    Select both the Enable Analytics and Universal Analytics checkboxes to turn on the tracking. (Universal Analytics is the latest version of the Google Analytics tracking code; you almost definitely want to use it.)
  9. Turn off tracking for your own visits (optional).
    Google Analytics tracks your own visits to your site, just as it tracks your visitors’ visits. If your site doesn’t get much traffic — and you visit your own site a lot — then your own visits can distort your Google Analytics reports quite a bit! To help with this, you can select the Disable GA on the frontend for Admin-level userscheckbox. This stops the Google Analytics tracking code being inserted into pages when you view your site. (Just make sure you’re logged in as a WordPress admin user whenever you visit your site!)
  10. Save your changes.
    You can ignore all the other settings for now. Click the Save Settings button to save your changes

Method B: Copy and paste the code into your WordPress theme settings

If you don’t want to install a plugin just to insert your Google Analytics tracking code, you can usually insert it manually into your pages by copying and pasting the JavaScript tracking code into your WordPress theme’s header.

  1. Log into your WordPress admin.
    Open a new browser tab and visit your WordPress admin page. Enter your admin username and password and click Log In.
  2. Access the theme settings.
    In the left-hand WordPress admin menu, choose Genesis > Theme Settings:
  3. Find the Header Scripts box.
    Scroll down the page until you see the Header Scripts box. It’s inside the Header and Footer Scripts section.
  4. Copy and paste the tracking code.
    Switch to your Google Analytics browser tab. Click the JavaScript tracking code in the box under Website tracking to select it, then choose Edit > Copy. Switch back to your WordPress browser tab, click the Header Scripts box, and choose Edit > Pasteto paste the tracking code into the box
  5. Save your changes.
    Click the Save Changes button at the bottom of the page to save your tracking code.

If you’re not using a Genesis theme then your admin page will look different, but there is usually a box called something like Header Scripts or <head> Code somewhere in the theme settings.

If you can’t find this setting in your theme, you can try pasting the JavaScript code directly into the theme’s header.php file. To edit your header.php file, choose Appearance > Editor in your WordPress admin and click the header.php template in the right column. Make sure you paste the code just before the </head> tag in the header.

Do you have any questions or roadblocks with setting up your Google Analytics? Feel free to ask them in the comments below!