GTM Archives - Direct Online Marketing https://www.directom.com/category/gtm/ Wed, 07 Aug 2024 16:30:00 +0000 en-US hourly 1 https://www.directom.com/wp-content/uploads/2025/01/favicon.png GTM Archives - Direct Online Marketing https://www.directom.com/category/gtm/ 32 32 How to Track Users Across Subdomains In Google Analytics 4 (GA4) – November 2024 https://www.directom.com/google-analytics-subdomain-tracking/ Wed, 07 Aug 2024 16:30:00 +0000 https://www.directom.com/?p=6397 Google Analytics Subdomain Tracking Looking for information regarding subdomain tracking for monitoring users across your entire platform in Google Analytics 4 (GA4)? Updated: 4/18/2024 “GA4 is set-up to handle subdomains automatically if the same GA4 measurement ID is shared across all subdomains of the same root domain.“ Dana Schumacher, Senior Digital Analyst at DOM How

Read More from How to Track Users Across Subdomains In Google Analytics 4 (GA4) – November 2024

The post How to Track Users Across Subdomains In Google Analytics 4 (GA4) – November 2024 appeared first on Direct Online Marketing.

]]>
Google Analytics Subdomain Tracking

Looking for information regarding subdomain tracking for monitoring users across your entire platform in Google Analytics 4 (GA4)?

Updated: 4/18/2024

GA4 is set-up to handle subdomains automatically if the same GA4 measurement ID is shared across all subdomains of the same root domain.

Dana Schumacher, Senior Digital Analyst at DOM

How much longer are you going to rely on Universal Google Analytics? You are at risk of losing any of your historical performance data in 2023 if you don’t set up and properly configure Google Analytics 4. Learn how the two platforms compare to each other in this blog post – Google Analytics 4 vs Universal Analytics.

Subdomains are a standard way to segment content on a website. Subdomains can be created at any time with no limit and with out a registrar. A common reason to create subdomains would be to differentiate a sector of your business such as “info.yoursite.com” or “tools.yoursite.com.”

From a developer’s perspective, subdomains are integral to utilizing multiple CMS platforms.  For this reason, they have become common across the web.

While subdomains have little benefit from an SEO viewpoint, many websites have plenty of justifications to leverage them.

How To Set Up Subdomain Tracking In Google Analytics

Configuring Google Analytics subdomain tracking can be somewhat aggravating and extremely cumbersome. If you are still using Universal Analytics and also have the need to setup tracking for subdomains – we strongly suggest setting up GA4 so you can avoid many of the remaining steps.

Despite being the market leader in web analytics, Google has been somewhat ambiguous on how to properly configure Google Analytics to track traffic between subdomains and root domains in an aggregate report (aka cross-subdomain tracking).

If this is your first time attempting to achieve correct cross-subdomain tracking, you’re in luck because this guide has made it simple for you.

Cross-Subdomain vs. Cross-Domain — What’s the Difference?

Understanding how cross-domain and cross-subdomain tracking differ from each other is crucial. The methods for implementation across each are entirely different.

source code text subdomain tracking

What’s The Difference Between A Root Domain And A Subdomain

To be clear, here is the difference between a (root) domain and a subdomain:

  • directom.com (root domain): Domains consist of various letter / number combinations followed by their domain extension (.com, .org, .gov, .edu, etc.)
  • cctld.directom.com (subdomain): Similar to root domains, except with a series of letters / numbers at the beginning, separated by a period (.)

Use cross-domain tracking when you want a single report that displays user behavior across two domains as if they were on a single domain. Without cross-domain tracking, GA will record a new session every time a user navigates between two or more domain properties.

How To Set Up Cross Domain Tracking In GA4

Trying to set up GA4 cross domain tracking?
We’ve got you covered in this blog post:
4 Steps To Set Up GA4 Cross Domain Tracking

You would need to implement cross-domain tracking if, for example, you wanted to track users across the following:

  • https://example.com
  • https://examplesite.com
  • https://www.othersite.com

Cross-subdomain tracking tracks users and sessions across different subsections of a single domain. We get requests to implement this type of tracking much more frequently than cross-domain tracking.

Some of the most common uses for subdomains include:

  • Foreign language versions of a website
    • de.example.com (<— German version)
  • Third-party marketing solutions/software (such as Marketo, Salesforce, Unbounce)
    • marketo.example.com
  • Blog hosting (typically when blog functionality is cost-prohibitive with current CMS)
    • blog.example.com
  • E-commerce checkout pages (typically third-party shopping cart solutions)
    • checkout.example.com

Please note — in the above examples, the root domain never changed. If you’re trying to track sessions across two root domains, we recommend following a different process.

For website owners with multiple subdomains, you need to implement cross-subdomain tracking if you want to track users across the following:

  • www.cctld.directom.com
  • www.es.directom.com
  • www.directom.com

Technical Side Note

Domain owners can create and manage as many subdomains as they want. Proper DNS configuration of subdomains is vital for tracking users across them.

If you make your way through this guide and are still not seeing proper site traffic across subdomains, it might be a good idea to get a second set of eyes to help identify the issue.

Before you continue, we cannot stress enough how getting the following items properly configured will give you a higher chance of success:

  1. Root domain & subdomain DNS settings
  2. GA account structure
  3. Implementation of the same GA code across all subdomains and the primary root domain

Assuming all of the above is good to go, you are ready to configure cross-subdomain analytics correctly.

If you’re dealing with a website with multiple subdomains, in most cases, you’ll want to configure the same Google Analytics 4 measurement ID/data stream across all subdomains.

Dana Schumacher, Senior Digital Analyst at DOM

Why Track Cross-Subdomain Traffic in Google Analytics as a Single Session?

By default, Google Analytics is not set up with cross-subdomain tracking. As a result, website owners will not have an accurate picture of how a user moved across subdomains and the root domain.

Here’s what happens normally: Every time a user comes to a website, GA tracking notes that visit as a session and begins tracking how that person interacts with a site.

Without cross-subdomain tracking, GA will count a new session every time a user goes from a subdomain to a domain (and vice versa). This means that total sessions are being miscalculated and referral data gets lost.

Translation — there’s no way to tell where a user came from and sessions become inflated.

Let’s say that an organic search user lands on a company’s blog from Google and the blog post lives on blog.example.com. After reading the post, the user wants to learn more about the company and fills out a contact form that lives on the root domain. Without proper subdomain tracking in GA, the conversion data will credit the subdomain as the referral source when really the user first came to the site from organic search.

Without correct referral source attribution, websites can’t tell which channels are the most effective for their goals.

subdomain tracking users across your platform

Most sites want to track user navigation between subdomains that share a root domain and the corresponding root domain as a single session. After tracking is set up, traffic sources, user actions and behavior completed on any subdomain can be attributed to the same user session.

For example, you might have a promotional landing page set up at info.example.com that directs users to purchase products at buy.example.com. With cross-subdomain tracking properly implemented, GA will count users landing on one subdomain and converting on another subdomain as a single session.

Heads Up, You Have Been (Un)Warned

Pulling up Google’s developer documentation for cross-domain tracking will prominently display a fun warning at the very top:

Google's cross-domain tracking warning Direct Online Marketing

If the owner of the world’s most ubiquitous analytics platform suggests that something is complex, they’re probably right.

Our advice — do not let Google psyche you out.

It is true that the code behind this configuration is complex.

However, we’ve pulled off quite a few Google Analytics implementations. We made this subdomain tracking resource easy to understand.

So, have no fear – this guide will walk you through a step-by-step process to follow that will help assure success.

Getting Started — The Typical Google Analytics Account Structure

The account structure hierarchy in Google Analytics is:

Analytics Account > Properties & Apps > Views

Analytics account structure hierarchy Direct Online Marketing

The image below represents how many analytics accounts are set up. This implementation structure consists of the following levels:

Google Analytics Heirarchy structure chart direct online marketing

Note that in the implementation above, all the items in the “Properties & Apps” row have unique tracking IDs. Having an implementation set up in this manner is pretty typical.

On the positive side, this setup makes accessing traffic and behavior across a single subdomain within an account a breeze.

Since every property has a unique tracking ID, the data associated with each domain or subdomain automatically populates as its default view and can be accessed without any further configuration.

On the other hand, this configuration makes it practically impossible to track cross-subdomain traffic.

How to Setup Subdomain Tracking In Google Analytics 4

  • Tools needed: Google Analytics, Google Tag Manager, Google Tag Assistant
  • Time required: 20 min
  • Estimated cost: $0

Figure out how Google Analytics tracking is implemented on your site. This guide will touch on how to set up cross-subdomain tracking for both hard coded Universal Analytics and Google Tag Manager configurations.

Before jumping into implementation, please note that this process will only work if your site is using the Universal Analytics version. For older websites with “Classic Analytics,” it is highly recommended to upgrade to the latest version.

In Google Analytics 4, users can be tracked cross-subdomains without the need for additional code. It should generally be handled using the same measurement ID and leveraging reporting, comparisons, and segments to address different subdomain data views.

If you are unsure which method you have implemented on your site, we suggest downloading the Tag Assistant (by Google) Chrome plugin or consulting your developer.

Part 1 – Set the cookieDomain

A cookie is a piece of code on a website that stores information about a session on a user’s computer.

To attribute the name of the domain in the information contained in a cookie, you will need to set the cookieDomain.

If Universal GA is hard coded on your site:

Congrats! The cookieDomain is set to auto by default, and you can skip right to part 2.

If Universal GA code fires through Google Tag Manager (GTM):

  1. Navigate to and select the container you wish to edit.
Google Tag Manager container edits Direct Online Marketing
  1. Click “Tags” on the left-hand menu.
Google Tag Manager Container Tags Direct Online Marketing
  1. Click on your Google Analytics Tag (In this example, our tag was named “Universal Analytics.” If you are unsure which of your tags is being used to send data to Google Analytics, look for the label “Google Analytics – Universal Analytics” in the “Type” column of the tags table.
Tag for Google Analytics Universal Analytics

  1. Click to edit the tag then proceed to “More Settings” > “Fields to Set.”
  2. Click “+ ADD FIELD.”
  3. Set the Field Name to “cookieDomain” and the Value to “auto.”
Fields To Set In Google Tag Manager For Universal Analytics for subdomain tracking

Part 2 – Update the Referral Exclusion List In GA4

This part is the same for both GTM and hard coded Universal Analytics implementations.

Note: In Universal Analytics, setting referral exclusions does not remove that data entirely. Instead, it just gets removed from the referrals are and gets populated as direct traffic.

In addition to that, there is a possibility that this step is already set up correctly in your account, but it is necessary for analytics to display accurate numbers. It is worth the two minutes it will take to double check. 

1) Log in to Google Analytics and select any view from the account that you wish to implement cross-subdomain tracking.

account view selection google analytics for subdomain tracking

2) Access the admin panel by clicking the gear icon in the bottom left of the screen.

google analytics admin panel for subdomain tracking

3) Under the property column, navigate to Tracking Info > Referral Exclusion List.

google analytics property column selecting referral exclusion list dom blog

4) Your root domain may already be in this table. If it is not, click the “+ ADD REFERRAL EXCLUSION” button and submit your root domain (yoursite.com).

In Google Analytics 4, referral exclusions can be easily set with the tag settings area of the data stream settings in GA4. Once you’ve configured those, GA4 identifies those unwanted referrals by leveraging the parameter “ignore_referrer.”

To review and make changes to your list of unwanted referrals in GA4, navigate to Data streams > Configure TA settings > Show all > List unwanted referrals.

Pro-Tip: Seeing Hostnames in Google Analytics 4

In Google Analytics, reporting will strip the hostname when examining exact URLs. If you’ve gone to the trouble of setting up cross-subdomain tracking, seeing whether someone landed on a subdomain or primary domain is essential context when analyzing performance data.

To see this information, navigate to a report where the primary dimension is a pageview (such as Site Content > All Pages/Landing Pages). Select the secondary dimension dropdown > Behavior > Hostname.

Keep in mind that when adding together.

It’s worth noting here that when you implement GA4, the hostname dimension is populated automatically. This is just one of the many ways GA4 is a less manual and easier to set up than it’s predecessor.

While these considerations are high-level best practice when configuring GA4 for multiple subdomains, we recommend that you also refer to Google’s documentation for more details on this subject.

Dana Schumacher, Senior Digital Analyst at DOM

Conclusion

Implementing cross-subdomain tracking has a reputation for being quite difficult, but it doesn’t have to be that way.  If you followed the steps in the guide above, you should have your implementation correctly set up in no time.

Just remember the two main parts:

    1. Set the cookieDomain.
    2. Update the referral exclusion list.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Premier Google Partner before you reach out.

The post How to Track Users Across Subdomains In Google Analytics 4 (GA4) – November 2024 appeared first on Direct Online Marketing.

]]>
Track ANY Form in Google Analytics in Under 5 Minutes (Updated August 2020) https://www.directom.com/google-analytics-form-tracking/ Wed, 26 Aug 2020 13:36:11 +0000 https://www.directom.com/?p=11148 Editor’s Note: Looking for information on how to do form tracking in Google Analytics? Are you still using the traditional version of the platform – Universal Analytics? You are at risk of losing any of your historical performance data in 2023 if you don’t set up and properly configure Google Analytics 4. Learn how the

Read More from Track ANY Form in Google Analytics in Under 5 Minutes (Updated August 2020)

The post Track ANY Form in Google Analytics in Under 5 Minutes (Updated August 2020) appeared first on Direct Online Marketing.

]]>
Editor’s Note: Looking for information on how to do form tracking in Google Analytics? Are you still using the traditional version of the platform – Universal Analytics? You are at risk of losing any of your historical performance data in 2023 if you don’t set up and properly configure Google Analytics 4. Learn how the two platforms compare to each other in this blog post – Google Analytics 4 vs Universal Analytics.

Tracking form submissions in Google Analytics can be tricky. We’ve seen multiple guides out there, yet many people are still confused regarding exact troubleshooting methods that apply across the board and are guaranteed to work.

Using the steps outlined below, we have yet to encounter a form that we couldn’t track in under 5 minutes.

To get this done efficiently, we have skipped over explaining the “why” for each method. All you have to do is follow along: Answer the following questions in order and follow the proceeding directions.

  1. Have you tried GTM’s generic form tracker?
    1. Yes – Proceed to step #2 below if it didn’t work
    2. No – Proceed to the “Implement GTM Generic Form Tracker” section
  2. When the form is submitted, does the URL redirect?
    1. Yes – Proceed to the “Track URL redirect upon form submission” section
    2. No – Proceed to step #3 below
  3. Does a thank you message or unique html element appear upon form submission?
    1. Yes – Proceed to “Track appearance of unique confirmation text” section
    2. No – Proceed to step #4 below
  4. Have you tried tracking Form Submission Button Clicks?
    1. Yes – Your blog post may be embedded in an iFrame
    2. No – Proceed to the “Track the form submit button click” section below

NOTE: You will need Google Tag Manager for each of the solutions below. If you haven’t already, head over to tagmanager.google.com and sign up for an account. You will need google tag manager for all of these solutions. For each solution below, we have created a preconfigured GTM container with the necessary code and settings already in place. All you need to do is import the container into your Tag Manager account (and update according to the specific instructions). If you are unsure how to import a container into GTM, please head over to our Google Tag Manager Recipe article and read the directions under the “How to Import a Container” section.

How to Test if Form Tracking is Working Correctly

  1. In the same Google Chrome browser, navigate to the following in separate tabs:
    1. Your website property in Google Analytics
    2. Your Google Tag Manager workspace
    3. The page on your website that contains the form you would like to track
  2. Click preview in the upper right hand corner of your GTM workspace
  3. Navigate to the browser tab that contains the form you are trying to track. We recommend clearing your page cookies by pressing Ctrl+Shift+r (reloads the window). Fill out the form you want to track and submit it.
  4. Switch to the tab containing your Google Analytics property
    1. Navigate to Real-Time > Events.
    2. You should see a window that looks similar to the image below:
  5. If you implemented form tracking successfully, the submit event will show up in the table (see image below). Be patient, sometimes it takes a few moments for the event to populate.
    Form tracking in google analytics using GTM

Implement GTM Generic Form Tracker

The very first method you should use to track a form is the one that relies on GTM’s standard form submission trigger. This doesn’t work for every form, but we always give it a try because it does work well in most cases. To implement, follow these steps:

  1. Download and import our pre-configured container: Form Tracker: Generic
  2. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration >
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.
  3. This form trigger should now fire on all forms on your website. Test if form tracking is working correctly
    1. If that didn’t work for you, proceed to #2 in the table of contents above. If you do see the event appear in your Google Analytics, congratulations, you have successfully tracked submissions to your form (don’t forget to publish your GTM container). This solution will track forms on all pages of your website. If you would like the generic form tracker to only fire on specific forms, follow the directions in step #4 below.
  4. If you only want to track forms on a specific page, try the following (Optional):
    1. Navigate to Triggers > Form Submission > Trigger Configuration > This trigger fires on > Enable this trigger when all of these conditions are true
      1. Change (.*) to the page path that contains the form you would like to track.

Track URL redirect upon form submission

If your form redirects to a new URL upon submission, try the following:

  1. Import our preconfigured GTM container: Form Tracker – URL Redirect
  2. In your GTM workspace, navigate to Triggers > Form Submission > Trigger Configuration > This trigger fires on
    1. Change “your-thank-you-page” to the page path that contains the form you would like to track.
  3. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration >
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.

Track appearance of unique confirmation text

If a unique thank you message or html element appears upon form submission, try the following:

  1. Note: Sometimes you can track when a form is submitted based on an element that appears on the screen. If you see a thank you message or something of the sort, follow the steps below. Here is an example of a thank you message that appears on a form that we use this method to track:
    GTM form tracking
  2. Install the Get Unique CSS Selector plugin for Google Chrome. It will help you find a unique CSS selector for the element.
  3. Fill out the form and click submit.
  4. With the “Get Unique CSS selector” plugin turned on, hover over the thank you message. You should see something like the screenshot below:
    GTM tracking form submissions in google analytics
  5. Right click on the thank you message and select “Copy Unique Selector to Clipboard”
    form tracking instructions
  6. Download and import our preconfigured GTM container – Form Tracker – Unique Element Visibility
  7. Navigate to Triggers > Form Submission > Trigger Configuration > Element Selector
    1. Replace “.copy-your-unique-selector-here” with the unique selector that you just copied to your clipboard.
  8. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration >
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.

Track the form submit button click

Note: This technically doesn’t track form submissions, just clicks on the button to submit the form. Depending on your needs, that may or may not be an issue. The number of times that a submit button is clicked often does not exactly match up with the number of times a form is successfully submitted; this is because users often click submit after entering data in the wrong format or missing required fields. To make the data as reliable as possible, we set the form submit trigger to only fire once per page per user. To track form submit button clicks, follow these instructions:

  1. Install the Get Unique CSS Selector plugin for Google Chrome. It will help you find a unique CSS selector for the submit button.
  2. With the “Get Unique CSS selector” plugin turned on, hover over the submit button. You should see something like the screenshot below:
  3. Right click on the highlighted submit button and select “Copy Unique Selector to Clipboard”
    form tracking instructions
  4. Download and import our preconfigured GTM container: Form Tracker – Submit Button Click
  5. Navigate to Triggers > All Page-views > Edit Trigger Configuration > This trigger fires on > Fire this trigger when an Event occurs and all of these conditions are true
    1. Change “.your-unique-css-selector-here” to the unique CSS selector that you copied to your clipboard above.
  6. Update your GA Settings Variable in your GTM workspace by navigating to Variables > GA Settings Variable > Variable Configuration > Edit Variable Configuration
    1. Change the Tracking ID from UA-00000-00 to match your GA tracking ID. If you don’t know how to get your GA tracking ID, follow the instructions here.

The above methods for implementing form tracking in Google Analytics cover almost every single form you will come across. The rare exceptions to this are forms that are embedded in an iframe.

Want to be able to use your data to make better decisions to help grow your business? Learn more about our expert marketing analytics services here.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Partner Agency before you reach out.

The post Track ANY Form in Google Analytics in Under 5 Minutes (Updated August 2020) appeared first on Direct Online Marketing.

]]>
What Is Google Tag Manager and Why Does Your Site Need It? (Updated July 2020) https://www.directom.com/google-tag-manager-beginner-guide/ Fri, 10 Jul 2020 11:18:16 +0000 https://www.directom.com/?p=6514 Google Tag Manager (GTM) provides an easy-to-use method by which marketers and website owners can manage multiple technologies on their sites. It all has to do with JavaScript tags, which are little snippets of code on a web page that send information to third-party software. You may not realize it, but your website definitely has

Read More from What Is Google Tag Manager and Why Does Your Site Need It? (Updated July 2020)

The post What Is Google Tag Manager and Why Does Your Site Need It? (Updated July 2020) appeared first on Direct Online Marketing.

]]>
Google Tag Manager (GTM) provides an easy-to-use method by which marketers and website owners can manage multiple technologies on their sites. It all has to do with JavaScript tags, which are little snippets of code on a web page that send information to third-party software.

You may not realize it, but your website definitely has tags on it. JavaScript tagging is the tool which makes it possible to run ads on Google or Facebook, as well as tracking how users engage with your website.

Before the creation of tag management technology like GTM, tags had to be hard-coded and applied to every single page of a site, whether directly on each page or through a shared template. 

For many years, site owners were left with few options to manage all of their tags. Then in 2012, Google Tag Manager was introduced as a simple interface and central hub for site owners to control how and what they track on their website. Not only does GTM make tag management easier, but the service has also always been free to use.

GTM is designed to streamline tag management while eliminating the need to work with a web developer to implement tracking code to one or more pages on your site.

However, implementing Google Tag Manager isn’t always a simple process. Some developers debate whether using it is even worth getting it set up on their site.

Google Tag Manager Terminology

Developer Looking At a Screen of Code Google Tag Manager

Before we jump in, let’s get familiar with a few definitions and terms which pertain to Google Tag Manager.

Containers

Similar to the account structure within Google Analytics, a user can create a Google Tag Manager account to manage multiple websites or mobile apps. When managing individual properties, account users will set up what is known as a container.

A container functions as a method for grouping tags together. Through the GTM interface, users can integrate all of their supported tags into a single container.

Think of GTM containers as a shopping basket where you drop in all of the items you want to buy. You could try and juggle each item in your arms, but the basket functions as a more effective way to keep them together.

Within the GTM interface, the container is where you will also find the code snippet you’ll apply to all pages on your site. This is your container code, and it needs to be in the source code within each page of your site.

Once a container exists, and you’ve configured all tags in GTM, this container code is all you need on your site, as opposed to multiple code snippets on each page. From there, GTM breaks out tracking configuration into three categories: tags, triggers, and filters.

Tags

A few of the uses for tags include monitoring form submissions, conducting surveys, generating heat maps, placing cookies for retargeting, and tracking how people interact with your site.

Tags can also monitor specific events or actions users take such as downloading files, clicking on particular links, or adding items to their shopping cart.

Websites often leverage multiple tags, and they usually require assistance from developers or designated CMS plugins to manage them. With GTM, website owners can add, edit, or disable tags right from the GTM interface, removing the need for extra development efforts.

Triggers

Think of triggers as conditions that, once met, tell your tags to activate or “fire.” User actions taken on your website—commonly referred to as events—can only be monitored with the help of pre-defined triggers.

Common actions that will cause triggers include form fills, link clicks, and page scrolls. In order for an engagement metric to be measured, events must have a trigger associated with them.  

Triggers in GTM essentially automate your tagging efforts and require you to spend less time assigning new tags to the pages of your site.

Filters

After defining the type of trigger you want, you can refine your trigger further with filters. Categorized into “operators” and “values,” these factors are specific to their trigger.

  • Operators define whether a numerical event is significant enough to cause a trigger; For example less than two, equal to 3, or greater than ten. Operators specify when a tag should fire based on an event, such as several successive clicks, time spent on a page, or time spent watching a video occurring a set number of times.
  • Values dictate whether a trigger should be fired based on a met condition. The value may have to contain a specific URL or words like “thank you.”

Variables

Variables are defined conditions that signify when a trigger should cause a tag to fire, containing information a trigger needs to evaluate beforehand.

  • Tag Variables: Capture dynamic values. This variable adds context to your tracking for when you want details about the event. 
  • Trigger Variables: Define filters for when tags should fire. Trigger variables make sure your GTM tracks specific actions instead of a broad umbrella of actions. For example: fire a pageview trigger when the URL variable is “directom.com/contact-us/.”

Templates

If you find yourself using the same variables and filters over and over again, you have the option to make templates that can prepopulate fields and create a defined set that you can use to automate the often time-intensive work of setting up your GTM.

Immediate Benefits of GTM

If you’re wondering whether GTM is right for you, GTM’s functionality for managing tags, most notably with an application to Google’s suite of other platforms.

Google Tag Manager with Other Google Products

GTM is often used to install Google Ads tracking code on your site. If you are contemplating using Google Ads and haven’t set up appropriate tracking or you feel like optimizing your current configuration, doing so via GTM will make your life easier. 

Paid Search Performance Dashboard with Google Tag Manager

Outside of Google Ads, GTM and Google Analytics work together to track your website events and reduce code edits on your backend. With GTM, Google Analytics can collect event data like button clicks and scroll length.

In fact, Google Analytics by itself is not equipped to track events. GA alone is only configured to record traffic data, and not for recording events like button/link clicks. Note that you can implement event tracking in GA without GTM. However, you would need to apply your tracking code on a page-by-page basis.

As you can imagine, that is an extremely manual process and a huge time-suck.

Utilizing Google Tag Manager for both GA and Google Ads will reduce the amount of friction between marketing teams and web developers while enabling marketers to implement advanced tracking for their campaigns.  

Here’s a look at a few other uses for Google Tag Manager:

Other Common GTM Uses

  • Heatmapping/CRO software: Conversion rate optimization (CRO) aims to make your website more conversion friendly by tracking how users interact with your site. With the help of GTM, CRO implementations can be put in place to track events and user behavior without having to code it into the specific pages being tested. For those familiar with heatmapping software such as Hotjar, GTM allows you to implement their tracking code easily.
  • Pixel conversion tracking: Using GTM to install display and social pixel conversion tracking works, in the same way, as it does with Google Ads and GA implementation.

Making Your Life Easier in the Long Run

The learning curve for understanding GTM is steep; however, once you master the basics, tracking becomes simpler in the long run. Luckily, with its testing feature, you have more control over the implementation of your tags before publishing.

For sites and businesses engaged in multiple online marketing platforms, GTM will condense all your separate codes and pieces into one place.

If you’re interested in getting more value and actionable insights from your Google Analytics data, talk to us today to sign up for a FREE digital marketing audit.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Premier Partner before you reach out.

The post What Is Google Tag Manager and Why Does Your Site Need It? (Updated July 2020) appeared first on Direct Online Marketing.

]]>
A Digital Marketer’s Guide to Button Tracking Using Google Tag Manager and Google Analytics https://www.directom.com/button-tracking-with-google/ Wed, 08 Jul 2020 19:08:57 +0000 https://www.directom.com/?p=12230 Editor’s Note: Looking for information on how to set up button tracking Google Analytics through Google Tag Manager? We get it. It’s also likely that you are still using the traditional version of the platform – Universal Analytics. In case you didn’t know, you are at risk of losing any of your historical performance data

Read More from A Digital Marketer’s Guide to Button Tracking Using Google Tag Manager and Google Analytics

The post A Digital Marketer’s Guide to Button Tracking Using Google Tag Manager and Google Analytics appeared first on Direct Online Marketing.

]]>
Editor’s Note: Looking for information on how to set up button tracking Google Analytics through Google Tag Manager? We get it. It’s also likely that you are still using the traditional version of the platform – Universal Analytics. In case you didn’t know, you are at risk of losing any of your historical performance data in 2023 if you don’t set up and properly configure Google Analytics 4. Learn how the two platforms compare to each other in this blog post – Google Analytics 4 vs Universal Analytics.

You’ve got your website up and going strong, using some best SEO practices or maybe driving traffic from an ad or two, and you have buttons that you want your readers to click. Buttons are useful for prompting your readers to take an action — clicking a button signals intent, and a customer indicating intent is a customer getting closer to converting.

What good is a button if you’re not keeping track of who’s clicking it? This is just scratching the surface of what Google Analytics can do for your button tracking needs, but it’s the perfect place to start.

Before You Begin:

  • Make sure you have Google Analytics installed on your site.
  • Make sure click variables are enabled/checked and published in GTM.
    • Variables > Configure > Clicks

button tracking with google tag manager and google analytics

Step 1: Understanding How to Locate Your Available Button Selectors

  • In GTM, go to preview mode by clicking on “Preview.”
  • Open the webpage where your button is located.
    • You should see the GTM preview pane show up on the bottom of the screen showing a summary on the left and all your tags fired and tags not fired.

button tracking with google tag manager and google analytics

  • Click on the button you’re looking to track. This will create a new step in the summary section.
  • Locate the click you just generated by clicking on the button and click on it. From there, select the “Variables” option on the header of the GTM preview pane.

button tracking with google tag manager and google analytics

  • The preview pane will populate with the following information:
    • Variable
    • Variable Type
    • Return Type
    • Value

For this exercise, we’ll be focusing on the Variable and the corresponding Variable Value to set-up tracking for the button.

Step 2: Understanding & Choosing the Selectors Available to You

As mentioned above, the Variable and Variable Value will be used to track your button clicks. Some items to consider when choosing your selector:

  • You’ll want to make sure the variable and value you choose is unique and is not somewhere else on your site.
    • If the variable and value are not unique, you may have to use a combination of selector methods to track one particular button.
    • If the variable value is blank or contains “, you cannot use that variable and variable value to track the button.
      • Well, you could. But we’re not going into that level of development and detail in this post.
    • Choose your variable and variable value. In this case, I’m going to use the “Click Classes” variable and the corresponding variable value of ‘callout-wrapper.’
      • Make note of the variable and variable value, we will be using this information in Step 3.

button tracking with google tag manager and google analytics

 

Step 3: Setting Up in Google Tag Manager – Trigger:

  • In Google Tag Manager, navigate to the Triggers section. Click “New” to create a new trigger.
    • Pick a name for your trigger. Make sure this name is somewhat descriptive and easy to identify what it’s referring to.
    • Configure your trigger.
      • Choose your trigger type by selecting “Click – All Elements.”
      • Choose when your trigger fires by selecting “some clicks.”
      • Refer to the variable and variable value selected to fill out the conditions for when the trigger fires. For this trigger we will make the following selections:
        • Click Classes
        • Equals
        • callout-wrapper

button tracking with google tag manager and google analytics

      • Save your trigger

Step 4: Setting Up in Google Tag Manager – Tag:

  • In Google Tag Manager, navigate to the Tags section. Click “New” to create a new tag.
    • Pick a name for your Tag. Make sure this name is something somewhat descriptive and easy to identify what it’s referring to. I recommend naming it something similar to your trigger.
    • Configure your tag.
      • Choose your tag type. In this case, “Google Analytics: Universal Analytics.”
      • Choose your track type. In this case, “event.”
        • Set up the naming and configuration for your Google Analytics event:
          • Category
          • Action
          • Label
          • Value (this field is not necessary and is only used in some cases)
        • Choose your correct Google Analytics Setting variable.
      • Choose the correct trigger for your tag. In this case, it will be the trigger we created in Step 3.
      • Save your tag.

button tracking with google tag manager and google analytics

Step 5: Test Out Your Set-up:

  • Open up your corresponding Google Analytics profile and navigate to Realtime – Events reporting. Keep that tab open.
  • Once you’ve set up and saved your trigger and tag, click on “Preview” in Google Tag Manager. Keep tag manager open.
  • In another tab, load the page that contains the button that we just set-up tracking for.
    • You should notice that the tag we just created should be in the Google Tag Manager preview pane under “tags not fired.”
  • Click on the button you just set-up tracking for.
    • You should notice that the tag we just created should move to the “tags fired” area of the preview pane.

button tracking with google tag manager and google analytics

  • Once you’ve confirmed the tag is working in Google Tag Manager, check your Realtime > Events reporting in Google Analytics.
    • You should see the event populating in Google Analytics.

button tracking with google tag manager and google analytics

You did it! Now enjoy the fruits of your labor. You earned it.

If you’d like to do more with tracking or Google Analytics, don’t miss these articles:

 

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Premier Partner before you reach out.

The post A Digital Marketer’s Guide to Button Tracking Using Google Tag Manager and Google Analytics appeared first on Direct Online Marketing.

]]>
6 of the Best Google Tag Manager Recipes [Free Downloads] (Updated 2020) https://www.directom.com/best-google-tag-manager-recipes/ Wed, 08 Apr 2020 18:06:32 +0000 https://www.directom.com/?p=10857 A Google Tag Manager (GTM) container is a set of macros, rules, and tags within a GTM account. Containers can be exported from one account and imported into another to save time and increase efficiency. When a GTM container is exported, it exists as a piece of JSON code. I’ve created several useful GTM containers.

Read More from 6 of the Best Google Tag Manager Recipes [Free Downloads] (Updated 2020)

The post 6 of the Best Google Tag Manager Recipes [Free Downloads] (Updated 2020) appeared first on Direct Online Marketing.

]]>
A Google Tag Manager (GTM) container is a set of macros, rules, and tags within a GTM account. Containers can be exported from one account and imported into another to save time and increase efficiency. When a GTM container is exported, it exists as a piece of JSON code.

I’ve created several useful GTM containers. You can download any of my GTM containers for free. Using a few easy steps, you can vastly improve website functionality.

How to Import a Container

Once you’ve downloaded your GTM container, follow the below steps to import it. If you want to go straight to the downloadable containers, scroll down.

  1. In Google Tag Manager, click the admin tab
  2. Under Container, click “Import Container”
  3. Choose the following settings on the “Import Container” page:
    1. Select a file to import -> choose the file you just downloaded
    2. Choose workspace -> Existing -> Select your existing workspace
    3. Choose an import option -> Merge (Unless otherwise specified)
  4. Click on variables in your GTM workspace. Under User-Defined Variables, look for a variable named UA-XXXXXXXX-X (or something similar).
    1. If this variable exists, change the name and value of the variable in your Google Analytics UA code. If you are unsure where to locate your UA code, visit Google Analytics > Admin > Property > Tracking Info > Tracking Code

GTM Container Recipes


GTM Container Recipe #1

Track Pageviews in Google Analytics

This script is all you need to get Google Analytics pageview tracking functioning correctly through Google Tag Manager. Simply import the container and enter your UA code as explained in step 4 above.

Download This Container


GTM Container Recipe #2

Track Contact Link Clicks in Google Analytics

This container enables you to track contact link clicks on your website as Google Analytics events. If a website visitor clicks on a “tel:” or “mailto:” link on one of your pages, an event is recorded by Google Analytics. You can find the event action in Google Analytics under the Real-Time > Events report, or view historical aggregate data under Behavior > Events > Overview.

Download This Container


GTM Container Recipe #3

Cross-Domain Tracking

Cross-domain tracking is a way to analyze visitors across multiple websites in a single analytics view. Implementing cross-domain tracking grants you access to multiple website traffic channels as if they were a single website. If you are looking to implement cross-domain tracking, download the script here and check out my article – set up cross-domain tracking with Google tag manager in 7 easy steps.

Download This Container


GTM Container Recipe #4

Clear GTM Container

This functional GTM container helps website owners test new implementation. This container clears all tags, triggers, variables, and folders from your GTM implementation – allowing you to start fresh. Be sure to select “overwrite” when importing this container.

Download This Container


GTM Container Recipe #5

Track Copied Text in Google Analytics

Interested in knowing which text is copied on your website? Import this GTM container and an event will be sent to Google Analytics every time your website visitors copy text to their clipboards.

Here’s a working example:

As a bonus, the event label is set to the copied text, so you can see the exact text copied right in the Google Analytics interface.

Download This Container


GTM Container Recipe #6

Add Link to Website in Copied Text

In container 5 above, I showed you how to track when text is copied from your website to a visitor’s clipboard. This container is similar in that it also tracks copied text, but this time for the purpose of adding a custom message to the user’s clipboard. This seems to be most often used to add a reference link to the clipboard text. A good example of a website that leverages this functionality is BrainyQuote. As an example, I copied a quote from BrainyQuote’s Scooter Braun page to my clipboard (see image below).

When pasted, the following text was output:

I want to show that you can be a successful entertainment executive, be a good husband, be a good father, be a good friend, be down to earth, be a good person, and give back. If I can push that message out there into the world and pass it on to my son, then I’m OK.
Read more at: https://www.brainyquote.com/quotes/scooter_braun_884325

Note that “Read more at…” was appended to the copied text. This script will enable you to add similar functionality to your website. To get this functionality on your website, simply download the container and import it into your GTM workspace.

Download This Container


Conclusion

GTM containers help simplify otherwise confusing or laborious website code install issues. Website owners can quickly add new code with little hassle. Install downloadable GTM containers with ease and save time. These containers also add sophisticated functionality to your website.

If you like this post, you might also like my free Google Data Studio report templates article. Similar to this post, it contains a few preconfigured resources that may be of help.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Premier Partner before you reach out.

The post 6 of the Best Google Tag Manager Recipes [Free Downloads] (Updated 2020) appeared first on Direct Online Marketing.

]]>
7 Easy Steps To Set Up Cross Domain Tracking With Google Tag Manager (Updated 2020) https://www.directom.com/cross-domain-tracking-google-tag-manager/ Tue, 18 Feb 2020 17:29:43 +0000 https://www.directom.com/?p=10446 Editor’s Note: With the announcement that Google is going to be sunsetting Universal Analytics in 2023, this process for setting up cross domain tracking will become obsolete. Trying to set up and properly configure cross domain tracking in Google Analytics 4? Learn how to do that here – 4 Easy Steps To Set Up Cross

Read More from 7 Easy Steps To Set Up Cross Domain Tracking With Google Tag Manager (Updated 2020)

The post 7 Easy Steps To Set Up Cross Domain Tracking With Google Tag Manager (Updated 2020) appeared first on Direct Online Marketing.

]]>
Editor’s Note: With the announcement that Google is going to be sunsetting Universal Analytics in 2023, this process for setting up cross domain tracking will become obsolete. Trying to set up and properly configure cross domain tracking in Google Analytics 4? Learn how to do that here – 4 Easy Steps To Set Up Cross Domain Tracking With GA4.

Let’s begin by dispelling the myth that cross-domain tracking is difficult to set up: it isn’t.

If all you want to do is get cross-domain tracking functioning correctly on your website, feel free to skip ahead to the section titled “Part II: Steps to Setting Up Cross-Domain Tracking.” If you follow the steps outlined in that section, you will have a correctly functioning installation of cross-domain tracking with no changes to your existing data.

There are, however, some confusing aspects of cross-domain tracking, and they all have to do with understanding the concepts behind it.

If you feel you need to brush up on the broad picture of cross-domain tracking, don’t skip ahead, just keep reading—because Part I of this article will explain the following:

  1. What is cross-domain tracking?
  2. Why would I need cross-domain tracking?
  3. What are the implications of cross-domain tracking?

Part I: Overview of Cross-Domain Tracking

1. What Is Cross-Domain Tracking?

Cross-domain tracking is a way to analyze visitors across multiple websites in a single analytics view. Implementing cross-domain tracking essentially allows you to report on the traffic of multiple websites as if they were one big website.

From a conceptual point of view, Google has added its fair share of red tape to what could be a very simple thing to achieve. I suspect that a correctly set up GA account is used as partial input into the RankBrain portion of Google’s ranking algorithm (in effect—positive feedback propagation), though I have little concrete evidence to support this.

In Part I of this guide, I will attempt to explain the concepts behind this implementation process. This will be helpful to those of you who have read enough to be effective, but still cannot fully grasp cross-domain tracking.

Part II is a step-by-step procedure for implementing cross-domain tracking. Feel free to skip ahead to that section if you don’t care about “why” this is the only method that works.

2. Why Would I Need Cross-Domain Tracking?

First and foremost, please be sure that you are looking to track users across multiple domains and not multiple subdomains.

If you are unsure of the difference, please read the “Cross-subdomain vs. Cross-domain” section of the following article: How to Track Users Across Subdomains.

3. What Are the Implications of Cross-Domain Tracking?

With conventional GA account set up (without cross-domain tracking), there is a 1:1 ratio of domains to properties—meaning that each domain under a given account is set up as its own property with a unique tracking ID.

This is great for understanding user behavior across single sites, but does not allow for macro-level insights. Companies that own multiple domains often need to know how users behave across multiple related websites.

A prime example we commonly see is within the ecommerce industry, where many sites use a third-party payment domain such as PayPal. When customers make a purchase, they are redirected to a PayPal domain and then redirected back to the ecommerce site following payment.

Without cross-domain tracking, the user experience is split into 2 unique sessions and the acquisition medium/source for the purchase is set to referral/PayPal, instead of retaining the original medium/source (which was most likely not referral/PayPal but something like organic/google).

Using the account structure above, imagine that a user navigates the following path: Google Search > exampleSite1.com > exampleSite2.com.

In the above scenario, Google Analytics will report one session under the exampleSite1.com property views as organic search traffic AND one session under the exampleSite2.com property views as referral traffic from exampleSite1.com. This means that looking at the data as a whole, we would see the following:

If we were to export the raw data from these two GA properties and combine the two sets of data, we would gain little to no valuable insights. This is because under the conventional setup, a new session is created when a user travels from one domain to another.

To correctly report cross-domain tracking, we need to negate this problem so that our example user is reported as a single session, as seen in the chart below, regardless of the domain visited:

This is great for understanding user behavior across single sites, but does not allow for macro-level insights. Companies that own multiple domains often need to know how a single user behaves across multiple related websites.

You may think that simply applying the same tracking code to multiple websites would fix this issue, but it doesn’t. Instead, sessions are still reset upon cross-domain navigation. Additionally, this type of fix makes reporting at the page level very confusing because visitors of exampleSite1.com/pageA.com and visitors of exampleSite2.com/pageA are both reported to be on the same page, namely pageA.

You may have come across other methods to implement cross-domain tracking, but be warned: every one of these methods will have negative consequences for your site traffic data. I highly recommend that you follow the steps outlined in Part II of our guide below to set up cross-domain tracking.

Part II: Steps to Setting Up Cross-Domain Tracking

1. Set Up Google Analytics

If you don’t currently use GTM for page tracking on your site, we recommend creating a completely new account structure that will be used exclusively for cross-domain tracking. Setting up your GA in this way will allow you to keep the existing tracking codes on your websites. Plus, it will not change the way your data is reported in the views you currently use.

To create a new GA account, navigate to the admin section of Google Analytics and click “Create Account.” You will only need one property in this account, as we will use the same tracking ID for all websites that you wish to include in cross-domain tracking.

If you do currently use GTM for page tracking on your site, you should finish out the remaining actions for step 1 below, then skip step 2, and proceed to the “Configure Existing Container” section of step 3.

To finish setting up your GA account, you will have to update the referral exclusion list and prepend hostname to URLs. Updating the referral exclusion list ensures that the session count is not reset when a user navigates between domains.

To add domains to the referral-exclusion list, navigate to Google Analytics > Admin > Property > Tracking Info > Referral Exclusion List > Add Referral Exclusion. Add all of the domains that you wish to be included in cross-domain tracking separately to this list.

Next, you should tell GA to prepend hostname to URLs. This is a fancy way of saying we would like to see the entire URL in the GA reports, instead of just the page name. This is important because if user A is on www.exampleSite1.com/pageA and user B is on www.examplesite2.com/pageA, without making this change, both users would be reported to be on /pageA. And, there would be no context to distinguish which site these users were on.

To prepend hostname to URLs, navigate to the admin section of GA > View > Filters > Add Filter. Use the following settings:

Filter type: Custom filter > Advanced

Field A ? Extract A: Hostname = (.*)

Field B ? Extract B: Request URI = (.*)

Output to ? Constructor: Request URL = $A1$B1

Check the following boxes: Field A Required, and Override Output Field

2. Create a GTM Account

If you already have a GTM account, you can proceed to the next step, “Configure GTM Container.” If you do not have a GTM account, you can create one by visiting the Google Tag Manager website, logging in using a Google account, and clicking “Create Account.”

You will then be taken to the form in the screenshot below. Fill it out and click “Continue.”

The second half of the form will then appear. Name your container, click “Web,” and then click “Create.”

3. Configure GTM Container

Import preconfigured container

Click the link and download the container to your computer. Navigate to the admin section of your GTM account, and click “Import Container.”

Select the container file on your computer, choose to import to an existing workspace, and select “Default Workspace.” Select the “overwrite” import option, and click “Confirm.”

There are only two changes that you have to make to the container to get it up and running.

Navigate to the variables section of your workspace and you will see two variables defined under user-defined variables: Auto_Link_Domains and Tracking_ID. Set the value of Auto_Link_Domains to a comma-separated list of the domains you wish to include in cross-domain tracking, and click “Save.”

Set the value of Tracking_ID to the tracking ID of the GA property you want to use for cross-domain tracking. This can be found within Google Analytics under Admin Section > Property > Tracking Info > Tracking Code.

Configure Existing Container

Make sure that you have an existing container that uses a tag of type “Google Analytics – Universal Analytics.”

You can check this by clicking on tags in Google Tag Manager and searching for “Google Analytics – Universal Analytics” under the type column. See the screenshot below for an example.

If you don’t see a tag of this type, you are OK to go ahead and use the preconfigured container outlined in the step above. If you do see a tag of this type, there are two changes that you need to make to it.

First, click on the tag to edit it. Under More Settings > Fields to Set, set Field Name to “allowLinker” and Value to “true.”

Next, under More Settings > Cross Domain Tracking, enter a comma-separated list of the domains you wish to include in cross-domain tracking.

4. Insert Code on Website and/or Remove Old Code

Publish your GTM container live by clicking the “Submit” button. If you already use GTM on your website, congratulations: you have implemented cross-domain tracking! You can skip the remainder of this step.

If you have not previously used GTM on your website, you must install the tracking code. Within your GTM workspace, navigate to Admin > Container > Install Google Tag Manager. Follow the steps there to install the GTM code on your website.

If you have any existing tracking codes on your website, you should not remove them.

Congratulations! If you followed the steps in this tutorial, you have successfully implemented cross-domain tracking.

Conclusion

The goal of this blog post is to simplify the integration of cross-domain tracking. As you may have noticed, most of the difficulty is in understanding the concepts behind it in order to select the correct parameters for your environment.

If you have any questions or are interested in getting more value and actionable insights from your Google Analytics data, ask us today for a free consultation.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Premier Partner before you reach out.

The post 7 Easy Steps To Set Up Cross Domain Tracking With Google Tag Manager (Updated 2020) appeared first on Direct Online Marketing.

]]>
WordPress: Google Analytics Installation Made Easy https://www.directom.com/wordpress-google-analytics-installation-made-easy/ Fri, 05 Jul 2019 17:47:54 +0000 https://www.directom.com/?p=11274 Editor’s Note: Looking for information on how to install Google Analytics on your WordPress site? Are you still using the traditional version of the platform – Universal Analytics? Take a second to think ahead and proactively set your campaign tracking up for success in 2023 by setting up and properly configuring Google Analytics 4 instead.

Read More from WordPress: Google Analytics Installation Made Easy

The post WordPress: Google Analytics Installation Made Easy appeared first on Direct Online Marketing.

]]>
Editor’s Note: Looking for information on how to install Google Analytics on your WordPress site? Are you still using the traditional version of the platform – Universal Analytics? Take a second to think ahead and proactively set your campaign tracking up for success in 2023 by setting up and properly configuring Google Analytics 4 instead. Learn how the two platforms compare to each other in this blog post – Google Analytics 4 vs Universal Analytics.

Google Analytics is a core component to an online marketing strategy for your website. If you have not yet installed Google Analytics (GA) on your site, I would suggest that you do so immediately. GA gives you insights into your website’s traffic data that enables you to take your marketing to an unprecedented level.

Note: The next section briefly explains the importance and functionality of Google Analytics. This section is not essential to installing GA so feel free to skip ahead.

What is GA and why would I want it?

A properly installed GA implementation includes hundreds of reports, broken down into five main categories: Realtime, Audience, Acquisition, Behavior, and Conversions.

Think about this, without using GA data, any changes that you make on your website are done almost completely blind. True, you can base website changes on market research, user studies, and the resulting feedback you get from an increase or decrease in sales/leads, but this method is archaic and overwhelmingly inefficient in comparison.

With Google Analytics, you can find the barricades to conversion on your website with real-world user data. Here are a few example reports:

Figure : Acquisition/Behavior/Conversion Metrics segmented by the user’s browser

Figure : Goal Flow and User Drop-off

Figure : Social Network Value

Installing Google Analytics on WordPress

Step 1: Make a Google Analytics Account

Navigate to analytics.google.com and log in with a google account. If you don’t already have one, create one (its free). You will then be taken to the GA home page. Click the admin icon in the bottom left-hand corner of your screen (see image below).

Once you arrive to the admin page, click the blue button labeled “+ Create Account”

Fill out the information on the next page and click the blue “Get Tracking ID” button. A Google Analytics terms of service agreement will popup. Review it and click accept.

You will then arrive at a page like the one below (Note: you will have a different tracking ID):

It’s important to celebrate small victories so congrats – you just made a Google Analytics account and property. Unfortunately, we are not done yet. At this point, you can access your website’s GA dashboard, but it won’t be populated with any website’s traffic data. In order to pass this data, we need to get your website to collect information on its users and pass that information over to your Google Analytics dashboard.

Fun fact: with a solution like Google Site Kit or MonsterInsights, doing a manual addition of Google Analytics on a WordPress site is not necessarily “required.” Learn more about these tools in our list of the 12 best WordPress plugins for SEO.

Step 2: Decide Between gtag.js and gtm.js

Notice in the screenshot above there is a tracking ID, followed by a section labeled “Website Tracking” which includes three options for implementing the tracking code. The three methods are:

  1. Global Site Tag (gtag.js)
  2. Google Tag Manager (gtm.js)
  3. Additional Implementations

We will focus on options 1 and 2 in this post. The third option is for advanced implementations that are likely out of the scope of your needs and require advanced coding skills.

At the end of the day, both gtag.js and gtm.js will result in the same thing as far as we are concerned. Both code snippets allow you to track your user traffic as we have set out to do. The difference is in the expanded functionality that each provides beyond just tracking your site traffic.

If you are unsure which you should go with, refer to the following from Google’s developer reference guide. If you are still unsure, go with gtag.js:

Google Tag Manager or gtag.js?

Google Tag Manager is a robust and full-featured tag management system, which supports Google and 3rd party tags. You can add and modify tags through the Tag Manager interface without adjusting the code on your site. Learn more

If you are already using Tag Manager, you should continue to do so. If you don’t need a tag management system, it is fine to use the gtag.js tags provided by each product.

Tag Manager and gtag.js are built on the same infrastructure and should work properly if deployed on the same page.

Source: https://developers.google.com/gtagjs/

Step 3: Install tracking code on your site

Once you have decided whether you would like to install gtag.js or gtm.js, proceed to the relevant section below. Choose either step 3a or 3b:

3a) Installing gtag.js on your WordPress site

  1. Log in to the backend of your website (ex. www.examplesite.com/wp-admin)
  2. Navigate to Appearance > Editor (May be Theme Editor for some versions of WordPress)
  3. Find your theme’s header in the list of files on the right-hand side of the screen. The file is usually named header.php. You will know that you have the correct file if you can find the </head> tag in the body of the file. Here are examples from a few websites:

If you cannot find this file, you may be editing a child theme. In order to access the header.php file, you may have to select the parent theme. In the following screenshot, you can see that there is no header.php file located under theme files.

To access the header.php file, simply click the “select theme to edit” dropdown and select the parent theme (It will have the same name as the child theme but without the word “child”). As you can see in the following screenshot, on our example site, the header.php file was located within the parent theme.

  1. Copy the gtag.js code from google analytics. If you are unsure where this is located, navigate to your Google Analytics > admin > Property > Property Settings > Tracking Code > The code will be located under the Global Site Tag (gtag.js) label.
  2. Locate the </head> tag within your header.php file and paste the gtag.js code that you copied in step 4 above it.

3b) Installing gtm.js on your WordPress site

  1. Create a Google Tag Manager account. If you are unsure how to do so, see step 2 in this post.
  2. Read my blog post on the best google tag manager recipes and import GTM container recipe #1: Track Pageviews in Google Analytics.
  3. Within Google Tag Manager, navigate to the container that you wish to use on your site. Click on the blue GTM container ID located in the top right of the dashboard.
  4. A popup with the code to install GTM on your site will appear. Copy the code that is located in the top box directly underneath “Paste this code as high in the <head> of the page as possible:”
  5. Log in to the backend of your website (ex. www.examplesite.com/wp-admin)
  6. Navigate to Appearance > Editor (May be Theme Editor for some versions of WordPress)
  7. Find your theme’s header in the list of files on the right-hand side of the screen. The file is usually named header.php. You will know that you have the correct file if you can find the </head> tag in the body of the file. Here are examples from a few websites:

If you cannot find this file, you may be editing a child theme. In order to access the header.php file, you may have to select the parent theme. In the following screenshot, you can see that there is no header.php file located under theme files.To access the header.php file, simply click the “select theme to edit” dropdown and select the parent theme (It will have the same name as the child theme but without the word “child”). As you can see in the following screenshot, on our example site, the header.php file was located within the parent theme.

Locate the <head> tag within the header.php file and paste the code that you copied in step 4 above directly after that tag.

8. Return to Google Tag manager and copy the code in the bottom box, directly below “Additionally, paste this code immediately after the opening <body> tag:”

9. Return to your header.php file on your WordPress site, and paste the code that you just copied directly after the <body> tag. Note: spacing and exact placement of the code doesn’t matter as long as the code appears as the next element following the <body> tag.

Congratulations, you have just installed Google Analytics on your site. To test if you installed it correctly, return to your Google Analytics > admin > Property > Tracking Info > Tracking Code > Click the “Send test traffic” button.

Conclusion

Correctly installing Google Analytics onto your website can give you invaluable insights into your website’s performance and site visitor behavior. This data, when leveraged correctly, should be used to formulate the backbone of your digital marketing plan and has the potential to launch your business to a new level. Now you can make decisions based on data. This means you will be making more impactful decisions.

Want to be able to use your data to make better decisions to help grow your business? Learn more about our expert Google analytics services here.

To get more information on this topic, contact us today for a free consultation or learn more about our status as a Google Premier Partner before you reach out.

The post WordPress: Google Analytics Installation Made Easy appeared first on Direct Online Marketing.

]]>