You already know that you need Google Analytics on your website. (And if you didn’t know that, then I recommend reading my Intro to Google Analytics for Private Practices to find out why you need to drop what you’re doing and install it right away!) So now, you’re probably wondering how to actually add Google Analytics (GA) to your site. Well, buckle up for a fun (and slightly technical) ride to unlocking the power of analytics on your website. There are a lot of different website management systems out there, but I’m going to show you an easy way to cut through the difficult technical coding and implement everything using Google Tag Manager. Don’t worry, though—it won’t be too painful.
Okay, deep breath—and here we go.
Getting Google Analytics on your website isn’t rocket science, but it does take a little preparation. Here’s what you’ll need to get started:
- A Google account that only you have access to (if you don’t have a Google Account, you can follow these instructions to create one)
- Ability to add code to your website
- Roughly 15-30 minutes
Finally, make sure you can copy and paste like a pro!
Signing Up for Google Tag Manager (GTM)
First, you’ll need to sign up for a free Google Tag Manager account. (If you already have a Google account and are signed into that account, then this process will be super quick and easy.
After clicking the signup button, you’ll land on the Add a New Account screen. You can name your account anything you wish, but I would recommend using your company’s name. Once you fill in your account name, you’ll be prompted to set up a container. This sounds more confusing than it is. All you need to do is name your container after your website URL, which is “wayneenterprises.com” in the example below (please note that this is a fake website that I’m using as an example only). Then, select where you want to use this container. In this case, because this is going on your website, you’ll select “Web.” Finally, click “Create” and accept the terms of service agreement.
You’ll then see a screen like this:
Now, this is a moment when you might normally start to panic (especially if you aren’t a developer). But, I’m here to tell you not to worry. In fact, you can leave this screen alone for now and open up another tab in your browser. We’ll come back to it in a few minutes to finish this process.
Installing Google Tag Manager on Your Website
Okay, this is going to be the hardest part of getting Google Analytics on your website, but I’m going to do everything I can to make it as painless as possible.
First off, sign into your website’s content management system (CMS). For this example, I’m going to show you how this is done in WordPress (if you’re having trouble replicating this process in your own CMS, just let me know in the comments and I’ll see if I can help you out).
Once you’ve signed into WordPress, select “Plugins” on the left side of your dashboard, as shown below.
Then, select “Add New,” and search the plugins for “Header and Footer,” and install and activate the plugin (this plugin is free, and you can take a look at it here if you’re interested).
Ready for the hard part? Here it is: click back to the Google Tag Manager and copy all the code on that page. Then, click back to the tab that has WordPress open and paste the code into the <Head> Section Injection on every page. It should look like this:
After you’ve installed the plugin, click on “Settings”; then, click “Header and Footer.” That’ll take you to a page like this:
Finally, click “Save” at the bottom of the page—and you’re done! Well, you’re done adding code to your site, anyway. Pat yourself on the back; you made it through the hard stuff!
Setting Up Google Analytics
Now that your code is all ready to go on your site and you’ve set up some of your Google Tag Manager, it’s time to head to Google Analytics. Scroll a little ways down the page and click “Get Started” under the Google Analytics box.
You’ll then see a screen like this:
Click “Sign Up” on the far right. You’ll then land on this page:
It might look scary, but don’t worry. I’ll walk you through it!
First, set up the account name. It’ll probably be the same one you used for your account name in Google Tag Manager. Then, fill in your website name (this will probably be the same as your account name) and add your website URL.
If you have more than one website, you’ll want to use your corporation’s name as the name of your account. Then, your website name will be the individual website name with the URL specific to that website.
Now, select the industry option that best describes your website (for the average WebPT Blog reader, the most appropriate option is likely “Healthcare”). Then, choose the location and timezone of your business.
I’d recommend leaving all of the data-sharing settings checked. Now, click “Get Tracking ID.” Accept the terms of service. Okay, you’re done with the setup for now—but leave that page open. Time to go back to Google Tag Manager!
Setting Up Google Analytics on Your Site Through Google Tag Manager
We are nearing the end of the trip, everyone. Hang on tight—we're almost there!
On your Google Tag Manager account, you should see a screen like this:
To complete Google analytics setup, you’ll first need to click “Add a New Tag.”
You will then see this screen:
Click on the tag configuration box and select “Universal Analytics - Google Analytics” from the menu (it should be at the very top).
Now, you’ll enter your Tracking ID and Track Type—and you’ll have a ton of other options under “More Settings” and “Advanced Settings.” For this example, we are going to keep it simple and ignore the advanced settings and options. (If you’re interested in these or have a specific question about them, please let me know in the comments.)
Anyway, you’ll need to switch back to your Google Analytics tab and copy your Tracking ID. It should look something like this:
Copy the whole code (starting with the “UA”), switch back to your Google Tag Manager tab, and enter the code into the Tracking ID field. For this example, we’ll leave the Track Type as “Page View.” Then, click “Triggering” and select the only option available (it will say “All Pages” with the type “Page View”).
Your page should look like this:
Click “Save” in the top-right corner and name the tag.
Final step: Click “Publish” in the right corner of the screen.
When you click “Publish,” you’ll have the option to name your published edits and add a description. For example, you may want to name this “GA Version 1” and in the description write “created and deployed Google Analytics tag.” However, you normally only need to do this if you want to add more tags to your site in the future or if you need to update or fix an error with this version.
That’s it—once you publish the tag, it’ll be active on your website. Now, you just have one—and this time, I really mean one—last step before you can breathe a sigh of relief and call it a day.
Confirming That Your Google Analytics Tag is Working
Whew—talk about a lot of steps! Now comes the moment of truth: did it all work? Thankfully, there’s a quick and easy way to check. Head over and download the free Chrome extension from Google called Tag Assistant. Once it’s installed, navigate to your website and click on the Tag Assistant extension in the top right of your browser. You’ll then need to click “Enable” in the bottom-left corner and reload your web page.
It will then show you all the tags on your page, and if everything is working correctly, you should see something like this:
Double-check that the Tracking ID code is the same as the one you entered, and you’re all good to go! Google Analytics is official installed on your website and will start collecting data on your visitors right away.
Bringing it All Together
So you went through this whole process, and now you’re thinking, “What exactly do I do now that I have Google Analytics on my website?” Stay tuned: my next post will show you how to look at the data coming in, set up a dashboard to quickly assess how your visitors are interacting with your website, and create a few simple goals to inform you of when a visitor completes a contact form.
As always, feel free to ask any questions you have about this or anything else related to Google Analytics or Tag Manager in the comments.