Google Analytics Basics: How to Set it up Properly

img 0915

Google Analytics is the most well-known analytics program for digital marketing. The best part? It is absolutely FREE!

Digital marketing without using analytics is like driving a car in the night without any lights and your dashboard is not working. You do not know where you are going. You do not know how fast you are going. You do not know if you are heading in the right direction or not.

It is not any better than traditional marketing. Think of billboard ads and tv commercials. You invest a lot in producing them in terms of money and time. Then, you do not have a direct way of measuring their impact to your business.

It does not have to be that way. Google Analytics is fairly simple to setup (and use for that matter).

There are three phases in setting up Google Analytics properly. Each phase is also broken into two parts.

How to Setup Google Analytics

Setting up Google Analytics can be divided into three (3) phases:

  1. Creation of the necessary accounts
  2. Installing the code to your website
  3. Checking (and troubleshooting, if necessary) the data

Phase 1: Creation of Accounts

Creating the necessary accounts is the first step.

You will need to create (or login to) a Gmail account. From there, head on over to the Google Analytics (GA) and Google Tag Manager (GTM) websites.

You need both GA and GTM accounts because the former allows you to analyze your website while the latter allows you to make changes to your website without having to learn code; thus, future-proofing your website.

Step 1: Create a Google Analytics Account

  1. Go to analytics.google.com
  2. Login to your Gmail account
  3. Sign up for a Google Analytics account
  4. Choose Website
  5. Input Basic Information About Your Company and Website
  6. Scroll Down and Get Tracking ID
  7. Accept Terms of Service
  8. Take note of your Tracking ID.

Step 2: Create a Google Tag Manager Account

  1. Go to tagmanager.google.com
  2. Login to your Gmail account
  3. Enter your company name (account)
  4. Enter your website’s domain (container)
  5. Choose Web
  6. Accept Terms of Service
  7. Copy the two sets of code given

Phase 2: Installing the Code

Before editing or making any changes — whether that’s adding or updating a plugin, or editing the code directly— it’s best practice to create a backup of your website first.

Installing the code involves two parts as well.

First, you setup Google Analytics inside Google Tag Manager. Next, you install the GTM code on your website.

Again, the primary reason why you should setup your analytics this way is because GTM allows you to change settings or add other code in your website without having to tinker with code. You just install the GTM code and add/edit/delete codes inside GTM. To learn more about how you can do this, check out my article on Google Tag Manager.

Step 1: Install Google Analytics code in Google Tag Manager

  1. Get your Google Analytics Tracking ID
  2. Login to Google Tag Manager
  3. Choose the container name you just created
  4. Add a new tag
  5. Name the tag as “GA Pageview”
  6. Choose Google Analytics
  7. Choose Universal Analytics as a tag type
  8. Create a new variable
  9. Name the variable as “gaProperty”
  10. Choose constant
  11. Enter your GA Tracking ID (Phase 1, Step 1)
  12. Click continue
  13. Choose to fire tag on “All Pages”
  14. Create Tag

Step 2: Install the Google Tag Manager code on your WordPress website

This part assumes you are using a WordPress-hosted website. Earlier, there are two sets of code you have to install.

I have provided here two separate options for you to take:

Option 1: Install via header.php file
  1. Login to Google Tag Manager
  2. Choose the container name you want to use
  3. Go to Admin
  4. Choose Install Google Tag Manager
  5. Copy the code
  6. Login your WordPress dashboard
  7. Go to Appearance, then Editor
  8. Search for the header.php file
  9. Paste the code immediately after the opening body tag
  10. Update the File
Option 2: Install via the functions.php file (Genesis Framework)

Before editing or making any changes — whether that’s adding or updating a plugin, or editing the code directly— it’s best practice to create a backup of your website first.

This second option is what I recommend, especially if you are using the Genesis Framework.

  1. Go to your theme’s editor and add it to the functions.php file.
  2. Login to your WordPress account.
  3. Go to Appearance > Editor.
  4. At the right-hand portion, click on the functions.php.
  5. Scroll down until you see the end of the lines of code there. Remember to not touch anything else. A single mistake there can break your entire site.
  6. Add your code
  7. Hit save

Copy this entire code and paste it there, then replace the GTM-ABCDEF section with your own container ID.

// Add Google Tag Manager code in <head>
add_action( 'wp_head', 'google_tag_manager_head' );
function google_tag_manager_head() { ?>
	
//Replace this entire line with the first part of the code <head>

<?php }


// Add Google Tag Manager code immediately below opening <body> tag
add_action( 'genesis_before', 'google_tag_manager_body' );
function google_tag_manager_body() { ?>
	
//Replace this entire line with the second part of the code <body>

<?php }

You’ll then have something that looks like this…

// Add Google Tag Manager code in <head>
add_action( 'wp_head', 'google_tag_manager_head' );
function google_tag_manager_head() { ?>
	
    <! – Google Tag Manager – >
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-ABCDEF');</script>
<! – End Google Tag Manager – >

<?php }


// Add Google Tag Manager code immediately below opening <body> tag
add_action( 'genesis_before', 'google_tag_manager_body' );
function google_tag_manager_body() { ?>
	
<! – Google Tag Manager (noscript) – >
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-ABCDEF"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<! – End Google Tag Manager (noscript) – >

<?php }

Phase 3: Checking the Data

Just like the rest of this post, this is divided into two parts as well:

  1. Click on preview inside Google Tag Manager.
  2. Check real-time data in Google Analytics
  3. If it’s working, then hit publish

Step 1: Preview Your Container in GTM

  1. Go to your GTM account
  2. Click on preview at the top-right portion. The page will reload.
  3. Open a new tab and open your website.
  4. You should see the “tags” firing at the bottom of the screen
  5. If the tag is present, it’s working properly.
Google Tag Manager - Preview Tags Firing on Your Website

Step 2: Look at Real-Time Data in GA

  1. Go to your Google Analytics account
  2. Make sure you are in the Reports tab
  3. Click Real-Time
  4. Click Overview
  5. Open another tab in your browser and load any page on your website
  6. Go back to GA to see if it is working
    1. If it’s working, go back to GTM and click on “leave preview mode”
    2. If it’s not, it’s either you configured it wrong, or a plugin is preventing it from loading. Usually, ad blockers from your browser are the culprit.
Google Analytics Real-Time

Step 3: Publish Your Container

After verifying the data is coming in correctly, head back to Google Tag Manager and click on the submit button at the right-hand side.

You’ll be asked a few details to help you remember the changes you did. Once you’re done, click on Publish.

And that’s it.

You have now installed Google Analytics properly on your website using Google Tag Manager. Again, this is the ideal setup for adding code and apps to your website. That way, you don’t have to go through this setup again.

The next time you want to add code to your website, like the Facebook Pixel or your email marketing tracking code, or an A/B optimization software, you only have to add it via Google Tag Manager.

7 Essential Tools for Effective Digital Marketing

7 Essential Tools for Effective Digital Marketing

Businesses need to have an online presence if they expect to be successful in today’s fast-paced world. You hear this over and over again. But what is it what you exactly need to be effective?

You will get different answers from different people. Most of them are correct. In this post, I listed 7 essential tools that cover the basics of digital marketing. If you don’t have them, get them now!

1. Website

The website is the most basic digital asset you should have. If you do not have this, get one quickly!

Buy a domain name now to reserve your online presence. Just as an example, I bought my domain using GoDaddy. I am hosting my site (and all the files you can see here) through InMotion Hosting.

I used WordPress.org for the “design” of this site.

There are others you can use like Shopify, Blogger, SquareSpace, and Wix. It’s really up to your preference.

2. Blog

This cannot be stressed enough. Remember the cardinal rule in digital marketing? If you are not found online, you do not exist.

How do you get found online? Search engines.

The biggest, most popular and most-used search engine here in the Philippines is Google. If people cannot find you on Google’s Search Results Page, you don’t exist.

Why is a blog important?

The way search engines work is it “indexes” your website to see if there are new content, then rank it to other web pages depending on keywords and a lot of other technicalities. The takeaway, if you do not produce new content, your website would not be indexed regularly; therefore, it will not improve its ranking.

Still too technical? Imagine this situation.

You’re an administrative clerk who processes a lot of paperwork. You receive hundreds of documents you have to rank order of priority for your boss.

Jack and Jill give you some documents on a daily basis. You see him, smiles at you, hands you his files. On the other hand, Jill comes in only once a month to bring in 1-2 documents. Who do you think gets priority?

That’s how Google works. Google loves fresh, new content.

3. Social Media Accounts

This is also mandatory for businesses. But do not jump into all available ones out there.

A strategy has to be set in place if you want to put this to your advantage. For starters, create accounts on Facebook, Twitter, LinkedIn and Google+.

Lastly, avoid literally transferring your offline marketing activities to digital. It won’t work. People behave differently online.

4. Analytics Software

What you cannot measure, you cannot manage.

If you do not have any means of measuring your efforts, then there is no reason for you to undertake digital marketing. You are simply wasting company resources.

The most popular and free software is Google Analytics. All you need is a Google account and you install the code to your website and blog, then you are good to go.

5. Email Marketing Software

Email is still the best way to communicate if you want to engage your customers — if done right. It has a longer shelf life unlike a tweet or a status update on your social media accounts.

Email is also more personal. It does not need to be read or actioned upon now.

One rule in email marketing is if you can’t segment your list, you are not doing it right.

Start building your list now. Again, there are dozens of email marketing software out there. I’m a fan of ConvertKit so that’s something I strongly recommend you get as well.

6. Word Processor, Spreadsheet, and Presentation Tool

These tools might already have this on your computer, but your efforts as a marketer are not the end of its own.

You have to report on results and activities to your manager. You have to let other people (your teammates) know what is happening. Yes, you are busy. Everyone is busy.

Just think of it this way, if your boss does not know what she is spending for, do you think you will get that support for an additional budget increase? If she does not see the results of your efforts (note the highlight on results, not on the efforts), she will think you are crazy for asking additional funding because you have presented any results.

7. Calendar / Scheduler

Finally, a calendar is the seventh tool you need to have. Deadlines are called deadlines for a reason. Keep track of your commitments to show your professionalism. It makes you look good and lets other people know you are on top of what you are doing.

Content creation, brainstorming, iterating, presenting, designing, analyzing, proofreading, strategizing — all these should reflect in your calendar.

These are the 7 tools that are essential for effective digital marketing. Master them and incorporate them into your workflow. Eventually, you’ll want to get into more advanced tools that will help you automate the work you do.

Did I miss any of the basics? Let me know in the comments.