<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="https://behindthecheckout.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://behindthecheckout.com/" rel="alternate" type="text/html" /><updated>2023-05-09T13:34:32+00:00</updated><id>https://behindthecheckout.com/feed.xml</id><title type="html">Behind The Checkout</title><subtitle>Practical tech guides and tutorials for Marketers</subtitle><entry><title type="html">Go beyond the basics with Google Analytics</title><link href="https://behindthecheckout.com/beyond-the-basics-with-google-analytics" rel="alternate" type="text/html" title="Go beyond the basics with Google Analytics" /><published>2020-07-21T03:41:59+00:00</published><updated>2020-07-21T03:41:59+00:00</updated><id>https://behindthecheckout.com/beyond-the-basics-with-google-analytics</id><content type="html" xml:base="https://behindthecheckout.com/beyond-the-basics-with-google-analytics">&lt;style type=&quot;text/css&quot;&gt;
    img {
        margin: 20px 0;
        box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.09);
        -webkit-box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.09);
        -moz-box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.09);
    }
&lt;/style&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;READER NOTE: The following guide is not applicable for Google Analytics 4 (GA4).&lt;/code&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;You may find the guide informative if you are still using Universal Analytics.&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;defining-the-basics&quot;&gt;Defining “the basics”&lt;/h2&gt;

&lt;p&gt;The basic Google Analytics skillset for Digital Marketers often includes the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Confidently navigating to the Channels, Source/Medium, and Referrals tabs to view a breakdown of traffic by source (social, paid search, organic search, etc.)&lt;/li&gt;
  &lt;li&gt;Tagging links and emails with UTM params for tracking.&lt;/li&gt;
  &lt;li&gt;Tracking Ecommerce conversion rate and sales/revenue numbers.&lt;/li&gt;
  &lt;li&gt;Watching for changes in metrics like Bounce Rate or Average Time on Page to diagnose the impact that website changes have on conversions.&lt;/li&gt;
  &lt;li&gt;Keeping track of major site/store changes with annotations&lt;/li&gt;
  &lt;li&gt;Turning on Google Analytics Ecommerce for a platform like Shopify or BigCommerce.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this guide, I’ll lay out some intermediate-level GA tips and tricks to help Marketers move beyond this list of the basics, level up their personal GA skillset, and shore up their brand’s analytics data.&lt;/p&gt;

&lt;h2 id=&quot;intermediate-level-google-analytics-knowledge-for-digital-marketers&quot;&gt;Intermediate-level Google Analytics knowledge for Digital Marketers&lt;/h2&gt;

&lt;h3 id=&quot;what-youll-take-away-from-this-guide&quot;&gt;What you’ll take away from this guide&lt;/h3&gt;

&lt;p&gt;The end result of this guide will be a new “Clean Data” Google Analytics view for your web property (Ecommerce store, landing page, blog, etc.).&lt;/p&gt;

&lt;p&gt;This “Clean Data” view will include custom filters, exclusion lists, and configuration options that will make the day-to-day experience of using Google Analytics more pleasant for you and your team.&lt;/p&gt;

&lt;h2 id=&quot;in-this-guide&quot;&gt;In this guide:&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;#1-working-with-multiple-google-analytics-reporting-views&quot;&gt;Working with multiple Google Analytics reporting views&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#2-show-full-urls-for-page-view-data&quot;&gt;Show full URLs for page view data&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#3-show-full-page-urls-for-your-referrer-traffic&quot;&gt;Show full URLs for your referrer traffic&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#4-adding-filters-to-standardize-case-of-all-utm-parameters&quot;&gt;Adding filters to standardize case of all UTM parameters&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#5-add-a-filter-to-prevent-ga-code-hijacking&quot;&gt;Add a filter to prevent GA code hijacking&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#6-creating-and-maintaining-a-query-parameter-exclusion-list&quot;&gt;Creating and maintaining a Query parameter exclusion list&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#7-configure-a-referral-exclusion-list&quot;&gt;Configure a Referral Exclusion list&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#8-verify-google-search-console-ga-linking&quot;&gt;Verify Google Search Console &amp;lt;&amp;gt; GA linking&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#9-using-secondary-dimensions-and-advanced-filtering-to-mash-up-data&quot;&gt;Using secondary dimensions and advanced filtering to mash up data&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#10-an-additional-resource-for-those-using-shopify-or-shopify-plus&quot;&gt;An additional resource for those using Shopify or Shopify Plus&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;1-working-with-multiple-google-analytics-reporting-views&quot;&gt;1. Working with multiple Google Analytics reporting views&lt;/h3&gt;

&lt;p&gt;Before we dive into making any changes to our brand’s Google Analytics account, let’s make sure we have a place to “sandbox” our work.&lt;/p&gt;

&lt;p&gt;We’ll do this by creating a new Google Analytics “ Reporting View” that will contain the majority of our changes.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Views-base.png&quot; alt=&quot;An example of where &amp;quot;Views&amp;quot; live in the Google Analytics admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You may already be familiar with GA reporting views without knowing them by name. When a new tracking ID is created (the kind you might generate when setting up GA tracking for new website or blog), a default view is generated – that’s the “All Web Site Data” phrase that you are likely to see in the top left of your GA admin panel.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---default-view.png&quot; alt=&quot;Google Analytics creates a default view for all tracking IDs called &amp;quot;All Web Site Data&amp;quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve intentionally started the guide with the task to add a new view or two to your GA property, as it will be your insurance policy as we make changes + updates to your team’s GA account.&lt;/p&gt;

&lt;p&gt;Keep in mind that &lt;strong&gt;data sent to new GA views is not retroactive and will not backfill with historical data.&lt;/strong&gt; This means that the improvements and filters that we add in this guide will apply only to the page view + event data collected going forward.&lt;/p&gt;

&lt;p&gt;When I begin working with a new brand, I like to ensure that they have some variation of the following three views created and configured.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The default GA view (i.e. &lt;em&gt;All Web Site Data&lt;/em&gt;)&lt;/li&gt;
  &lt;li&gt;A raw and completely unfiltered view (i.e. &lt;em&gt;Raw Data&lt;/em&gt;)&lt;/li&gt;
  &lt;li&gt;A Marketing “Clean Data” view (e.g. &lt;em&gt;MarTech Clean Data&lt;/em&gt; or just &lt;em&gt;Clean Data&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keeping the &lt;em&gt;Raw Data&lt;/em&gt; view free of filters + customizations allows it to serve as a fresh start and an insurance policy in case any partners or colleagues make a change that disturbs data in the &lt;em&gt;All Web Site Data&lt;/em&gt; view.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---adding-a-new-reporting-view-in-admin.png&quot; alt=&quot;Adding a new reporting view in the GA admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here’s a look at what you should see after adding new views for &lt;em&gt;Raw Data&lt;/em&gt; and &lt;em&gt;Clean Data –&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---clean-views.png&quot; alt=&quot;A Google Analytics property configured with multiple reporting views&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ideally these views are added and configured at the same time a new GA Property is generated (again - data is not backfilled when a new view is added), but the reality is that most teams will add them much later on – totally ok!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: If your team is using Google Analytics Ecommerce, be sure to &lt;a href=&quot;https://support.google.com/analytics/answer/1009612?hl=en&quot;&gt;enable the GA Ecommerce Tracking toggle&lt;/a&gt; on each new view you create before moving on.&lt;/p&gt;

&lt;p&gt;Similarly, if your team has their &lt;a href=&quot;https://support.google.com/google-ads/answer/1704341?hl=en&quot;&gt;Google Analytics account linked to their Google Ads account&lt;/a&gt;, be sure to re-link GA &amp;lt;&amp;gt; Google Ads for each new view.&lt;/p&gt;

&lt;h3 id=&quot;2-show-full-urls-for-page-view-data&quot;&gt;2. Show full URLs for page view data&lt;/h3&gt;

&lt;p&gt;Now that we’ve got a fresh &lt;em&gt;Clean Data&lt;/em&gt; view to work in, let’s add a view filter to transform the URL displayed in the Behavior -&amp;gt; Site Content -&amp;gt; All Pages view from only the URL path (i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/about-us&lt;/code&gt;) into the full URL (i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yoursite.com/about-us&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---URL-filter-1.jpg&quot; alt=&quot;Before and after a &amp;quot;full URL&amp;quot; view filter is applied to a Google Analytics reporting view&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This change is especially helpful if your team is using the same GA Tracking ID (i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UA-12345678-1&lt;/code&gt;) in multiple locations (e.g. your main website, your blog, Zendesk support site, pageviews sent by various marketing tools, etc.)&lt;/p&gt;

&lt;p&gt;Without the addition of this URL view filter, all of the following traffic would be showing up under the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/&lt;/code&gt; page in the All Pages listing:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Your main website’s homepage (i.e. yoursite.com)&lt;/li&gt;
  &lt;li&gt;Your blog’s homepage (i.e. blog.yoursite.com)&lt;/li&gt;
  &lt;li&gt;Your Zendesk support site homepage (i.e. support.yoursite.com)&lt;/li&gt;
  &lt;li&gt;Views of your email pop-up marketing tool (e.g. BounceX, WisePops, or Privy)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To add this URL filter on all page view events that your GA tracking code sends to your &lt;em&gt;Clean Data&lt;/em&gt; reporting view, head to the GA admin panel and navigate to the &lt;em&gt;Filters&lt;/em&gt; tab_._&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Filters-admin-view.png&quot; alt=&quot;The &amp;quot;Filters&amp;quot; tab in the GA admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;From the Filters menu, click on “Add Filter” and create an Advanced Filter with the following settings:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Filter Name:&lt;/strong&gt; &lt;em&gt;View Full Page URL&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Filter Type:&lt;/strong&gt; &lt;em&gt;Custom -&amp;gt; Advanced&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Field A -&amp;gt; Extract A:&lt;/strong&gt; Select &lt;em&gt;Hostname&lt;/em&gt; from the dropdown list and enter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(.*)&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Field B -&amp;gt; Extract B:&lt;/strong&gt; Select &lt;em&gt;Request URI&lt;/em&gt; from the dropdown list and enter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(.*)&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Output To -&amp;gt; Constructor:&lt;/strong&gt; Select &lt;em&gt;Request URI&lt;/em&gt; from the dropdown list and enter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$A1$B1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Checkboxes:&lt;/strong&gt; Select &lt;em&gt;Field A Required&lt;/em&gt; and &lt;em&gt;Override Output Field&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s what the completed filter should look like once completed:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---full-URL-filter.jpg&quot; alt=&quot;&amp;quot;View Full Page URL&amp;quot; GA View filter configuration&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;3-show-full-page-urls-for-your-referrer-traffic&quot;&gt;3. Show full page URLs for your referrer traffic&lt;/h3&gt;

&lt;p&gt;Here’s a great one that I learned from a post written by &lt;a href=&quot;https://gleam.io/blog/google-analytics/&quot;&gt;Stuart McKeown at Gleam.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you’ve ever been frustrated by the fact that GA does not show the full URL path for referring page data (aka seeing only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mashable.com&lt;/code&gt; instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mashable.com/articles/post-about-your-brand&lt;/code&gt; ), you can add the following filter to enhance your referrer URL data going forward.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GA filter to show full referrer URL&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Filter Name:&lt;/strong&gt; Display full referring URLs&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Filter Type:&lt;/strong&gt; Custom -&amp;gt; Advanced&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Field A -&amp;gt; Extract A:&lt;/strong&gt; select “Referral” from the dropdown and enter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(.*)&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Field B -&amp;gt; Extract B:&lt;/strong&gt; leave this blank&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Output To -&amp;gt; Constructor:&lt;/strong&gt; select “User Defined” from the dropdown and enter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$A1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Check the following boxes:&lt;/strong&gt;“Field A Required” and “Override Output Field”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s what the completed filter will look like:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---full-referrer-filter.jpg&quot; alt=&quot;Google Analytics filter to display full referring URLs&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now you can go to any report and add the “User Defined” Secondary Dimension to see the full referring URL for applicable traffic. Some useful reports where you might wish to view the full referring URL:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;See which article a specific purchase came from (&lt;em&gt;Conversions -&amp;gt; Ecommerce -&amp;gt; Sales Performance&lt;/em&gt;)&lt;/li&gt;
  &lt;li&gt;See which organic social content is driving traffic to top landing pages (&lt;em&gt;Acquisition -&amp;gt; Social -&amp;gt; Landing Pages&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Adding-a-secondary-dimension-for-User-Defined-Variable.png&quot; alt=&quot;Applying a secondary dimension of &amp;quot;User Defined Variable&amp;quot; to a report to see full referring URLs in the GA Admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Below is a look at what we can expect to see in the &lt;em&gt;Acquisition -&amp;gt; All Traffic -&amp;gt; Referrals&lt;/em&gt; report after making this change.&lt;/p&gt;

&lt;p&gt;You can filter down to only rows that have something other then “(not set)” by using the following regex on a Secondary Dimension filter of &lt;em&gt;User Defined Value&lt;/em&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[^(not set)]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---full-referral-URLs.png&quot; alt=&quot;Acquisition -&amp;gt; Referrals report in the GA dashboard with the &amp;quot;User Defined&amp;quot; secondary dimension applied&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;4-adding-filters-to-standardize-case-of-all-utm-parameters&quot;&gt;4. Adding filters to standardize case of all UTM parameters&lt;/h3&gt;

&lt;p&gt;While we’re still in view filter creation mode, let’s tackle another common issue - inconsistent UTM parameter case data.&lt;/p&gt;

&lt;p&gt;This issue manifest as an alert in the Google Analytics dashboard titled, &lt;strong&gt;“Duplicate Campaign Parameters.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Duplicate-Campaign-Parameters.png&quot; alt=&quot;A GA error notification for Duplicate Campaign Parameters&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Why do we often see these errors? Google Analytics treats UTM parameter values as case-sensitive values.&lt;/p&gt;

&lt;p&gt;As brands start working with external Marketing partners and agencies, it becomes almost impossible to maintain case consistency across everyone who is adding UTM params to links on a daily basis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example of the “Duplicate Campaign Parameters” issue:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a page view hit comes in for traffic tagged with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yoursite.com?utm_source=Newsletter&amp;amp;utm_campaign=July4thPromo&lt;/code&gt; (where “Newsletter” is capitalized”), GA records that UTM Source value separately from a page view hit for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yoursite.com?utm_source=newsletter&amp;amp;utm_campaign=july4thpromo&lt;/code&gt; (where “newsletter” is lowercased).&lt;/p&gt;

&lt;p&gt;The previous example would appear in Google Analytics Acquisition -&amp;gt; All Traffic -&amp;gt; Source/Medium tab grouped as separate campaigns.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Newsletter / July4thPromo - 1 visit&lt;/li&gt;
  &lt;li&gt;newsletter / july4thpromo - 1 visit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The ideal case would be for visits to be grouped together into a single Source/Medium line item:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;newsletter / july4thpromo - 2 visits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While it’s possible to create internal guidelines and request that everyone on the team always uses the same case format when tagging links with UTM parameters, adding lowercase standardization filters in GA will save you the hassle of corralling co-workers and external partners to follow the guidelines in the future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding lowercase filters to standardize UTM values in Google Analytics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The process for adding lowercase filters is very similar to how we added &lt;em&gt;View Full Page URL&lt;/em&gt; in the previous step. First, head to the GA admin panel and click to add a new filter in your &lt;em&gt;Clean Data&lt;/em&gt; reporting view.&lt;/p&gt;

&lt;p&gt;We’ll be creating lowercase filters for the following cases, covering all standard UTM parameters and search terms:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Campaign Name&lt;/li&gt;
  &lt;li&gt;Campaign Source&lt;/li&gt;
  &lt;li&gt;Campaign Medium&lt;/li&gt;
  &lt;li&gt;Campaign Term&lt;/li&gt;
  &lt;li&gt;Campaign Content&lt;/li&gt;
  &lt;li&gt;Search Term&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For each of the cases above, add a filter following the format below. Here’s what to configure for each filter, using &lt;em&gt;Campaign Name&lt;/em&gt; as our example:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Filter Name:&lt;/strong&gt; &lt;em&gt;Lowercase - Campaign Name&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Filter Type:&lt;/strong&gt; &lt;em&gt;Custom -&amp;gt; Lowercase&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Filter Field:&lt;/strong&gt; Select the appropriate UTM value from the dropdown, i.e., &lt;em&gt;Campaign Name&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-analytics---lowercase-filter.jpg&quot; alt=&quot;A GA lowercase filter for Campaign Name&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;5-add-a-filter-to-prevent-ga-code-hijacking&quot;&gt;5. Add a filter to prevent GA code hijacking&lt;/h3&gt;

&lt;p&gt;Here’s another filter that I first discovered from &lt;a href=&quot;https://gleam.io/blog/google-analytics/&quot;&gt;Stuart McKeown at Gleam.io&lt;/a&gt;. Let’s go over the context and reasoning behind adding this filter.&lt;/p&gt;

&lt;p&gt;It may sound surprising, but, when collecting data, Google Analytics does not verify that the domain where a tracking snippet is installed matches the domain that was registered when the tracking snippet was created. This means that anyone with your GA ID (i.e. GA-12345678-1), can send traffic and events from their website directly into your GA dashboard and reports.&lt;/p&gt;

&lt;p&gt;For example, we could send page view data from our website into Glossier’s Google Analytics account simply by adding their GA ID (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UA-53766669-1&lt;/code&gt;) into the tracking snippet on our brand’s website.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Glossier-s-GA-ID-in-plain-view.png&quot; alt=&quot;The Google Analytics tracking ID for glossier.com&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why would someone take your Google Analytics ID and send fake traffic to your brand’s GA account?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This issue often comes in the form of someone taking the HTML source code of your site, changing the content, and hosting it elsewhere. Sometimes this is someone taking shortcuts in the web development process and neglecting to remove your brand’s GA snippet as they copy your site’s code. Other times it can be truly malicious, like when a bad actor may clone your Ecommerce store to sell counterfeit goods using your brand name and assets.&lt;/p&gt;

&lt;p&gt;Regardless of the reason for this bad data, it’s impossible to delete erroneous traffic and event data once it has reached the GA dashboard. The suggested filter below is an insurance policy to prevent a black swan event from disturbing your hard-earned GA metrics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting up the anti-hijacking filter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To combat unauthorized data from being sent to our property, we can create a filter to discard any GA data that does not come from a domain (i.e. yoursite.com) that we’re expecting traffic from.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important disclaimer:&lt;/em&gt; As this could cause your data to be lost if incorrectly configured, be sure to create a new &lt;em&gt;Test&lt;/em&gt; reporting view to confirm your filter before implementing this on your &lt;em&gt;Clean Data&lt;/em&gt; or &lt;em&gt;All Web Site Data&lt;/em&gt; views.&lt;/p&gt;

&lt;p&gt;Before configuring the filter, we also need to gather a list of all existing domains that are sending legitimate traffic to our GA property. To find the list of other legitimate domains that may be sending data to your property, look at the “hostname” value, available as a primary dimension from the &lt;em&gt;Behavior -&amp;gt; Site Content -&amp;gt; All Pages&lt;/em&gt; report. (Be sure to expand the date range as wide as possible to capture all possible 3rd party hostnames.)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---add-hostname-filter.png&quot; alt=&quot;Setting &amp;quot;Hostname&amp;quot; as the primary dimension on the Add Pages view&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You’ll need to include more than just your base domain (e.g. yoursite.com) in this list, as you may be sending traffic from external sources like a landing page platform, email platform, or marketing tool with a different domain or subdomain. Common examples of external traffic sources that you’d want to retain include Mailchimp’s .list-manage.com unsubscribe pages, Zendesk’s yoursite.zendesk.com help center, etc.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---reviewing-hostname-list.png&quot; alt=&quot;An example list of domains to whitelist in our GA anti-hijacking filter&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once you have your list of domains ready, enter them in a filter named “Mitigate hijacking” with the following configuration. Because you’ll likely be including multiple domains, be sure to to enter them in the RegEx format below (e.g. everything separated by a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|&lt;/code&gt; character and escaping &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.&lt;/code&gt; with a backslash).&lt;/p&gt;

&lt;p&gt;Example of what we’ll paste into the “Filter Pattern” field:&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;yoursite.com&lt;/td&gt;
      &lt;td&gt;yoursite.zendesk.com&lt;/td&gt;
      &lt;td&gt;.list-manage.com&lt;/td&gt;
      &lt;td&gt;.campaign-archive.com&lt;/td&gt;
      &lt;td&gt;staging/.yoursite.com&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Example completed anti-hijacking filter:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---anti-hijacking-filter.jpg&quot; alt=&quot;Example Google Analytics anti-hijacking filter&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be sure to communicate this filter change to your team&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don’t forget to share the addition of this filter with your Marketing, Product, and Engineering teams. Often times the setup process of new 3rd party Marketing or Engineering services will involve pasting in your brand’s Google Analytics tracking ID.&lt;/p&gt;

&lt;p&gt;Now that you have this anti-hijacking filter enabled, your team team will need to update it with the domain of all new 3rd party platforms (i.e. newservice.com) before data from those services can be captured by your GA property.&lt;/p&gt;

&lt;h3 id=&quot;6-creating-and-maintaining-a-query-parameter-exclusion-list&quot;&gt;6. Creating and maintaining a Query parameter exclusion list&lt;/h3&gt;

&lt;p&gt;You’re likely familiar with Query Parameters from your team’s usage of UTM parameters. These are the key/value pairs that appear at the end of URLs.&lt;/p&gt;

&lt;p&gt;A common example of a query parameter would be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fbclid&lt;/code&gt;, a query parameter that Facebook’s Ad platform uses to track the performance of ads.&lt;/p&gt;

&lt;p&gt;A full example: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yourbrand.com?fbclid=abc123&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Query parameters like these are a useful way for Developers, Advertisers, and Marketers to pass through data to underlying analytics scripts or change content on the page without creating a battery of custom URLs.&lt;/p&gt;

&lt;p&gt;Where query parameters become tricky within Google Analytics is when they distort page view metrics in reports like &lt;em&gt;Behavior -&amp;gt; Site Content -&amp;gt; All Pages.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Without building and maintaining a query parameter exclusion list, each unique query parameter combination will be grouped together as its own line in the report. That means that if your team has been relying on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/&lt;/code&gt; line item in the &lt;em&gt;Behavior -&amp;gt; Site Content -&amp;gt; All Pages&lt;/em&gt; as a method of tracking total homepage page views, you may be unintentionally excluding homepage page views that had a query parameter value.&lt;/p&gt;

&lt;p&gt;In the below example, we see how visits to the same page parent URL are incorrectly grouped as three individual line items in the report because of differing query parameters (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;?lang=en-us&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;?lang=en-ca&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;linkId=85686530&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---All-pages-query-param.png&quot; alt=&quot;Example image via bounteous.com&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding a Query Parameter exclusion list&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To ensure that our future page view data comes in grouped by parent page (and not by parent page + query parameter), Google Analytics provides a place to paste a comma-separated list of all query parameters that we’d like to disregard in report views.&lt;/p&gt;

&lt;p&gt;You can find this in the GA admin panel under &lt;em&gt;View -&amp;gt; View Settings -&amp;gt; Exclude URL Query Parameters.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---exclude-url-params.png&quot; alt=&quot;GA Query Parameter exclusion list location&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In my experience, the easiest way to build this comma-separated list is to head to the &lt;em&gt;Behavior -&amp;gt; Site Content -&amp;gt; All Pages&lt;/em&gt; report and:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Add a search filter for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\?&lt;/code&gt; (display only page URLs with a query parameter present)&lt;/li&gt;
  &lt;li&gt;Expand the date range to include data from the past 12 months&lt;/li&gt;
  &lt;li&gt;Expand “Show Rows” to be the top 5,000 pages&lt;/li&gt;
  &lt;li&gt;Run a CSV export to review in Excel or Google Sheets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; You only need to include the “key” portion of the query parameter that you’d like to exclude in your list. AKA only the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fbclid&lt;/code&gt; portion of a string that looks like this: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;amp;fbclid=12345abcde&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Your end result should be a list that looks like something like this, though yours will vary greatly depending on the ad partners, marketing tools, and external tracking suites that your team uses.&lt;/p&gt;

&lt;!--kg-card-begin: markdown--&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;msclkid,subid,fbclid,campaignid,DT,BT,pi_bid_value
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!--kg-card-end: markdown--&gt;

&lt;p&gt;As you run audit and build an exclusion list, be careful not to strip out any useful internal query params that could help you cluster users in the future, like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yourstore.com?plan-selected=enterprise&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally, remember that query parameter exclusion lists are handled at the GA View level, so you’ll need to add them for your &lt;em&gt;All Web Site Data&lt;/em&gt; and &lt;em&gt;Clean Data&lt;/em&gt; views.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keeping the query param exclusion list updated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After your initial audit, I’d recommend spending a few minutes each day checking for any new query parameters that you might want to add to your exclusion list. You can move this to a weekly or monthly check with a calendar invite reminder after a week or so of daily checks.&lt;/p&gt;

&lt;p&gt;Note: It’s possible to discard &lt;em&gt;all&lt;/em&gt; query parameters with a GA view filter, but I don’t recommend that most teams take such a drastic approach until they’re more familiar with any internal query parameters that might contain data not available elsewhere in the URL path (i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yourstore.com?plan-selected=enterprise&lt;/code&gt;).&lt;/p&gt;

&lt;h3 id=&quot;7-configure-a-referral-exclusion-list&quot;&gt;7. Configure a Referral Exclusion list&lt;/h3&gt;

&lt;p&gt;Configuring your GA Referral Exclusion list is a quick task that can help clean up and/or prevent duplicate sessions from skewing the data available in your &lt;em&gt;Acquisition -&amp;gt; All Traffic -&amp;gt; Referrals&lt;/em&gt; and &lt;em&gt;Acquisition -&amp;gt; All Traffic -&amp;gt; Source / Medium&lt;/em&gt; reports.&lt;/p&gt;

&lt;p&gt;This is an especially important step if your team is using a platform like Shopify or has any integrations with external payment gateways like PayPal, Affirm, or AfterPay.&lt;/p&gt;

&lt;p&gt;If a Referral Exclusion list is not configured to exclude landing page builder, help center, and external payment gateway domains, you’ll lose the original traffic source for those users / sessions and be left with unhelpful self-referrals + duplicate sessions.&lt;/p&gt;

&lt;p&gt;Google’s documentation on the &lt;a href=&quot;https://support.google.com/analytics/answer/2795830?hl=en&quot;&gt;Referral Exclusion list&lt;/a&gt; provides a great example of why it’s so important to configure this list when dealing with cross-domain tracking:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Because each referral triggers a new session, excluding referrals (or not excluding referrals) affects how sessions are calculated in your account. The same interaction can be counted as either one or two sessions, based on how you treat referrals.&lt;/p&gt;

  &lt;p&gt;For example, a user on my-site.com goes to your-site.com, and then returns to my-site.com. If you do not exclude your-site.com as a referring domain, two sessions are counted, one for each arrival at my-site.com. If, however, you exclude referrals from your-site.com, the second arrival to my-site.com does not trigger a new session, and only one session is counted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Implementing a Referral Exclusion list&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To update your Referral Exclusions list, head to the GA admin panel and navigate to &lt;em&gt;Tracking Info -&amp;gt; Referral Exclusion List.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here’s what an example Referral Exclusion list might look like for a brand using both Shopify and Zendesk:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Referral-Exclusion-list-2.png&quot; alt=&quot;The Referral Exclusion List section of the GA admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To audit and make sure you’ve captured the full list of domains to add to your Referral Exclusion list, head to &lt;em&gt;Acquisition -&amp;gt; All Traffic -&amp;gt; Source/Medium&lt;/em&gt; and sort the &lt;em&gt;Ecommerce Conversion Rate&lt;/em&gt; column.&lt;/p&gt;

&lt;p&gt;If you spot any payment-related (afterpay.com, pay.google.com, etc.) or subdomain (try.yoursite.com) line items here with spectacular conversion rates (&amp;gt;25%) and significant volume (&amp;gt;10 purchases, depending on sales volume), it’s likely that the domain should be added to the Referral Exclusion list.&lt;/p&gt;

&lt;p&gt;Unlike the previous few changes we made with filters, this change is made at the GA Property level, meaning that we only need to make the change in one place for it to apply to all GA reporting views.&lt;/p&gt;

&lt;h3 id=&quot;8-verify-google-search-console--ga-linking&quot;&gt;8. Verify Google Search Console &amp;lt;&amp;gt; GA linking&lt;/h3&gt;

&lt;p&gt;There’s a common misconception that Google Analytics no longer displays information about organic Google.com searches.&lt;/p&gt;

&lt;p&gt;This misconception is driven by Marketers who arrive at the &lt;em&gt;Acquisition -&amp;gt; Campaigns -&amp;gt; Organic Keyword&lt;/em&gt; report and see a harrowing &lt;em&gt;“(not provided)”&lt;/em&gt; value representing 98.xx% of report traffic.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---organic-search-view.png&quot; alt=&quot;Organic Keywords displaying as (not provided) in a GA report&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Thankfully, &lt;a href=&quot;https://search.google.com/search-console/about&quot;&gt;Google Search Console&lt;/a&gt; provides an easy way to surface this obfuscated organic search data to our Google Analytics property. And, unlike most things we’ve covered in this guide, any data that already exists in your brand’s Google Search Console account will backfill to all our existing GA views.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; If you don’t already have a Google Search Console account with a verified web property, &lt;a href=&quot;https://search.google.com/search-console/about&quot;&gt;create one before continuing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Similar to the Referral Exclusion list, you’ll &lt;a href=&quot;https://support.google.com/analytics/answer/1308621?hl=en&quot;&gt;link your Google Analytics account to your Google Search Console account&lt;/a&gt; at the GA Property level.&lt;/p&gt;

&lt;p&gt;To do this, navigate to the GA admin panel and look for Property -&amp;gt; Property Settings -&amp;gt; Adjust Search Console.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Adjust-search-console.png&quot; alt=&quot;Linking Google Analytics with Google Search Console in the GA admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Next, click “Add” to be taken to a list of available GSC verified websites. Select the verified website that matches your GA view (i.e. select “yoursite.com” in GSC if your GA property is setup to track traffic for “yoursite.com”) and you’re all set!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---linking-GSC-site.png&quot; alt=&quot;Linking a Search Console site in the GA admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once your accounts are linked, you’ll be able to access detailed organic search data in your GA dashboard via the &lt;em&gt;Acquisition -&amp;gt; Search Console&lt;/em&gt; reports.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---full-organic-search-breakdown.png&quot; alt=&quot;The Search Console -&amp;gt; Queries report in GA after linking with Google Search Console&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;9-using-secondary-dimensions-and-advanced-filtering-to-mash-up-data&quot;&gt;9. Using secondary dimensions and advanced filtering to mash up data&lt;/h3&gt;

&lt;p&gt;Taking a break from being so tactical, let’s explore one of the most helpful GA tools that’s hidden just below the surface - Secondary Dimensions.&lt;/p&gt;

&lt;p&gt;If you’ve ever found yourself looking at a GA report wishing that you could “mash up” data from another view (i.e. wanting to see Source/Medium &lt;em&gt;and&lt;/em&gt; Campaign values all in one place), Secondary Dimensions are the answer.&lt;/p&gt;

&lt;p&gt;From almost any report in GA, select an item from the &lt;em&gt;Secondary Dimension&lt;/em&gt; dropdown list and you’ll see that data displayed next to the default view.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Secondary-Dimension-dropdown.png&quot; alt=&quot;The Secondary dimension dropdown menu in GA&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The change above will turn the &lt;em&gt;Source/Medium&lt;/em&gt; report into a full-featured report listing Source/Medium + Campaign together in one place.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---with-secondary-dimension-applied.png&quot; alt=&quot;Using Secondary dimensions to combine Source / Medium with Campaign values in GA&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Another longed-for report combination in the &lt;em&gt;Conversions -&amp;gt; Ecommerce -&amp;gt; Sales Performance&lt;/em&gt; report is the ability to see which campaign or referring URL a specific order came through.&lt;/p&gt;

&lt;p&gt;With secondary dimensions in GA, it’s as simple as adding a Secondary Dimension of &lt;em&gt;Campaign&lt;/em&gt; to see the specific campaign value for each Transaction ID:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Ecommerce-secondary-dimension.png&quot; alt=&quot;Using Secondary dimensions to combine Transaction ID with Campaign source values in GA&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now that we’re familiar with secondary dimensions, let’s take a quick look at GA’s &lt;strong&gt;Advanced Filtering&lt;/strong&gt; to see how they can help us more easily filter reports.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Advanced-Filtering-1.png&quot; alt=&quot;The trigger to expand GA's Advanced Filtering menu&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With the standard report search bar, we’re only able to search for a single value on the report’s primary dimension. In the example above, that means that we could not create a query of:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Show me all Transactions that came from a campaign with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;google&lt;/code&gt; in the campaign source.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With GA Advanced Filtering, we’re able to quickly create a query (using RegEx and exact matching if required) without leaving our report. Here’s an example:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Advanded-filtering-campaign-example-1.png&quot; alt=&quot;A GA Advanced Filter for Campaign source containing &amp;quot;google&amp;quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With this example Advanced Filtering enabled, our report now displays a full list of orders matching our query:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/Google-Analytics---Advanced-filtering-matching-query.png&quot; alt=&quot;A GA Sales Performance report with Advanced Filtering applied&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;10-an-additional-resource-for-those-using-shopify-or-shopify-plus&quot;&gt;10. An additional resource for those using Shopify or Shopify Plus&lt;/h3&gt;

&lt;p&gt;If you’re working on a store using Shopify or Shopify Plus, don’t miss out on this excellent guide to &lt;a href=&quot;https://www.digitaldarts.com.au/google-analytics-shopify&quot;&gt;Shopify &amp;lt;&amp;gt; Google Analytics&lt;/a&gt; written by Joshua Uebergang for Digital Darts.&lt;/p&gt;

&lt;p&gt;Joshua’s guide provides an excellent next step if you’ve completed all the setup steps in this article and are eager to further shore up your data connection between GA and your Shopify store.&lt;/p&gt;</content><author><name></name></author><category term="data-analytics-guides" /><summary type="html"></summary></entry><entry><title type="html">Customizing the Shopify Order Confirmation Page</title><link href="https://behindthecheckout.com/useful-shopify-confirmation-scripts" rel="alternate" type="text/html" title="Customizing the Shopify Order Confirmation Page" /><published>2020-04-28T02:17:02+00:00</published><updated>2020-04-28T02:17:02+00:00</updated><id>https://behindthecheckout.com/useful-shopify-confirmation-scripts</id><content type="html" xml:base="https://behindthecheckout.com/useful-shopify-confirmation-scripts">&lt;style type=&quot;text/css&quot;&gt;
    img {
        margin: 20px 0;
        box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.09);
        -webkit-box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.09);
        -moz-box-shadow: 5px 5px 5px 5px rgba(0,0,0,0.09);
    }
&lt;/style&gt;

&lt;p&gt;Below you’ll find a variety of useful snippets and techniques that you can use to customize the Shopify Order Confirmation page (AKA the &lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status&quot;&gt;“Order Status” page&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/shopify-order-confirmation-page.png&quot; alt=&quot;The Shopify Order Confirmation page from Splendid Spoon&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;in-this-guide&quot;&gt;In this guide:&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;#1-a-wrapper-script-to-fire-custom-conversion-ad-pixels-only-on-the-first-page-load&quot;&gt;A wrapper script to fire custom conversion / ad pixels only on the first page load&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#2-add-a-custom-message-to-checkout-confirmation&quot;&gt;Add a custom message to checkout confirmation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#3-customize-the-messages-placeholder-text-in-the-checkout&quot;&gt;Customize the messages / placeholder text in the checkout&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#4-add-an-optional-one-click-survey-question-to-the-confirmation-page&quot;&gt;Add an optional, one-click survey question to the Confirmation Page&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#how-to-test-customizations-made-to-the-order-confirmation-page&quot;&gt;How to test customizations made to the Order Confirmation page&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;when-do-customers-see-the-order-confirmation-page&quot;&gt;When do customers see the Order Confirmation page?&lt;/h2&gt;

&lt;p&gt;Your customers will see the Shopify Order Confirmation page in two locations on their Customer Journey:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;When a customer first completes their order (this is when Conversion Pixels and Scripts should fire).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;When a customer comes back to check on the status of their order and shipping information. Shopify’s default Order Confirmation and Shipping Confirmation emails include a “Track my shipment” button that takes them back to the Order Confirmation page.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/media/stasher-bag-shipping-confirmation-email.png&quot; alt=&quot;The Shopify Shipping Confirmation email from Stasher reusable storage bags&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;important-note-on-post-purchase-upsell--cross-promotion-apps&quot;&gt;Important note on Post-Purchase Upsell / Cross-Promotion apps&lt;/h2&gt;

&lt;p&gt;If you’re using a post-purchase Upsell or Cross-Promotion app, you’ll run into a different set of tracking pixel options than explained in this article.&lt;/p&gt;

&lt;p&gt;Elevar, one of my top recommendations for support with Ecommerce Analytics (they are truly excellent), has a &lt;a href=&quot;https://www.getelevar.com/shopify/configure-post-purchase-upsell-conversion-tracking/&quot;&gt;Post Purchase Upsell Tracking guide&lt;/a&gt; to help you navigate this alternate world where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;post_purchase_page_accessed&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;first_time_accessed&lt;/code&gt; work together.&lt;/p&gt;

&lt;p&gt;You can also review Shopify’s &lt;a href=&quot;https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/pixel-tracking-post-purchase-page&quot;&gt;official documentation for Pixel tracking on the post-purchase page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I highly recommend that you review the above guide + documentation, even if the company whose app you are working with has told you that they have migrated your existing conversion / tracking scripts as part of their installation process.&lt;/p&gt;

&lt;h2 id=&quot;customizing-your-shopify-order-confirmation-page&quot;&gt;Customizing your Shopify Order Confirmation page&lt;/h2&gt;

&lt;p&gt;###&lt;/p&gt;

&lt;h3 id=&quot;1-a-wrapper-script-to-fire-custom-conversion--ad-pixels-only-on-the-first-page-load&quot;&gt;1. A wrapper script to fire custom conversion / ad pixels only on the first page load&lt;/h3&gt;

&lt;p&gt;For most conversion / ad pixels that you add to your store, you’ll want to ensure that they only fire the first time a customer arrives on the Order Confirmation page.&lt;/p&gt;

&lt;p&gt;If the following custom code is not added, your conversion scripts / pixels will fire each time a customer visits to see the status of their order. This can cause lots of confusion for fellow Marketers and there’s no easy way to reverse the damage once duplicate transaction data has been sent to external ad platforms.&lt;/p&gt;

&lt;p&gt;The fix is straightforward, wrap your conversion scripts / pixels in this &lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/first-time-accessed&quot;&gt;official Shopify snippet&lt;/a&gt;.&lt;/p&gt;

&lt;!--kg-card-begin: html--&gt;
&lt;script src=&quot;https://gist.github.com/mattlebel/7e9b2d037ac135275bc06dce83c7c343.js&quot;&gt;&lt;/script&gt;
&lt;!--kg-card-end: html--&gt;

&lt;p&gt;Add this content to the “Confirmation Scripts” section of Checkout Settings – &lt;a href=&quot;yourstore.shopify.com/admin/settings/checkout&quot;&gt;yourstore.shopify.com/admin/settings/checkout&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/shopify-additional-scripts-box.png&quot; alt=&quot;Add conversion scripts / pixels in the Shopify Admin panel&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heads Up:&lt;/strong&gt; There’s no built-in version control on this content in the Shopify admin panel, so I highly recommend that you use &lt;a href=&quot;https://gist.github.com/&quot;&gt;GitHub Gists&lt;/a&gt; or a dedicated “Shopify Admin Content” GitHub repo to keep track of this &lt;em&gt;Additional scripts&lt;/em&gt; content.&lt;/p&gt;

&lt;h3 id=&quot;2-add-a-custom-message-to-checkout-confirmation&quot;&gt;2. Add a custom message to checkout confirmation&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/media/shopify-additional-order-confirmation-message.jpg&quot; alt=&quot;Add a custom message box to the Shopify Order Confirmation page&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To add a custom messaging section to the confirmation page, you can add the following script to the &lt;em&gt;Additional scripts&lt;/em&gt; field in Checkout settings.&lt;/p&gt;

&lt;p&gt;Note that this script would go in the “Scripts you want to run on every visit to confirmation page” section of the conversion script wrapper logic.&lt;/p&gt;

&lt;!--kg-card-begin: markdown--&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;script&amp;gt;
Shopify.Checkout.OrderStatus.addContentBox('&amp;lt;h2&amp;gt;Pick-up in store&amp;lt;/h2&amp;gt;',
'&amp;lt;p&amp;gt;We are open everyday from 9am to 5pm.&amp;lt;/p&amp;gt;')
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!--kg-card-end: markdown--&gt;

&lt;p&gt;This field supports liquid, so you can use snippets like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Thanks again, customer!&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Shopify provides some additional variations on this in their help center documentation:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/show-content-based-on-products&quot;&gt;Show content based on an order for a particular product&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/show-content-based-on-shipping-method&quot;&gt;Show content based on shipping method&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/show-content-based-on-location&quot;&gt;Show content based on customers’ locations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;3-customize-the-messages--placeholder-text-in-the-checkout&quot;&gt;3. Customize the messages / placeholder text in the checkout&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/media/shopify-checkout-langage-editor.png&quot; alt=&quot;Edit Order Confirmation page default text using the Shopify Language Editor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Want to update the default copy in the Shopify checkout flow and Order Confirmation page?&lt;/p&gt;

&lt;p&gt;There’s no need to add custom HTML or JavaScript to update the default system text that appears throughout the checkout process. To customize messages / placeholder text throughout checkout, use the Shopify Language Editor.&lt;/p&gt;

&lt;p&gt;This can be found under &lt;em&gt;Online store &amp;gt; Themes &amp;gt; Actions &amp;gt; Edit languages&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here’s a &lt;a href=&quot;https://help.shopify.com/en/manual/online-store/legacy/using-themes/change-the-layout/change-wording&quot;&gt;step-by-step guide to making changes to text on the Order Confirmation page&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;4-add-an-optional-one-click-survey-question-to-the-confirmation-page&quot;&gt;4. Add an optional, one-click survey question to the Confirmation Page&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/media/enquire-post-purchase-app.png&quot; alt=&quot;An example post-purchase survey with the Fairing Shopify App (formerly Enquire)&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I highly recommend the Fairing (previously named Enquire) Shopify app for this: &lt;a href=&quot;https://apps.shopify.com/fairing&quot;&gt;https://apps.shopify.com/fairing&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’re looking for more flexibility in survey logic, you can embed a &lt;a href=&quot;https://help.hotjar.com/hc/en-us/articles/115011787508-What-is-a-Hotjar-Survey-&quot;&gt;HotJar survey&lt;/a&gt; or &lt;a href=&quot;http://typeform.com/&quot;&gt;TypeForm&lt;/a&gt; and pass through Shopify email + order ID as &lt;a href=&quot;https://help.typeform.com/hc/en-us/articles/360029114712-How-to-use-Hidden-Fields&quot;&gt;Hidden Fields&lt;/a&gt;. Example:&lt;/p&gt;

&lt;!--kg-card-begin: markdown--&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;a class=&quot;typeform-share button&quot; href=&quot;https://YOUR-STORE.typeform.com/to/FORM-ID?order_id=&amp;amp;email_address=&quot; data-mode=&quot;popup&quot; data-auto-open=true data-hide-headers=true data-hide-footer=true data-submit-close-delay=&quot;5&quot; target=&quot;_blank&quot;&amp;gt; &amp;lt;/a&amp;gt; &amp;lt;script&amp;gt; (function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id=&quot;typef_orm_share&quot;, b=&quot;https://embed.typeform.com/&quot;; if(!gi.call(d,id)){ js=ce.call(d,&quot;script&quot;); js.id=id; js.src=b+&quot;embed.js&quot;; q=gt.call(d,&quot;script&quot;)[0]; q.parentNode.insertBefore(js,q) } })() &amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!--kg-card-end: markdown--&gt;
&lt;h2 id=&quot;how-to-test-customizations-made-to-the-order-confirmation-page&quot;&gt;How to test customizations made to the Order Confirmation page&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Test what an Order Confirmation page looks like for a specific customer’s order:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’re looking to simply preview what an Order Confirmation page looks like for a specific order, you can use a built-in Shopify feature available on all orders.&lt;/p&gt;

&lt;p&gt;This is a great way to confirm visual changes that you may have made, like &lt;a href=&quot;https://help.shopify.com/en/manual/online-store/legacy/using-themes/change-the-layout/change-wording&quot;&gt;changes to the wording&lt;/a&gt; on the Confirmation Page, the addition of a post-purchase survey app like &lt;a href=&quot;https://apps.shopify.com/fairing&quot;&gt;Fairing&lt;/a&gt;, etc.&lt;/p&gt;

&lt;p&gt;When viewing any individual order, select “View order status page” from the “More actions” dropdown menu and you’ll be able to see exactly what that customer sees when they click on the “Track my order” button in their Shopify Order Confirmation email.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/shopify-order-status-dropdown.png&quot; alt=&quot;View the Order Status page for an existing Shopify order&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An important note:&lt;/em&gt; No need to worry about throwing off your analytics or ad conversions by using this impersonation tool. Shopify’s built-in Google Analytics and Facebook Pixel integrations will only fire on the customer’s original visit to the Order Confirmation page.&lt;/p&gt;

&lt;p&gt;As long as you’re using the &lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/first-time-accessed&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if first_time_accessed &lt;/code&gt; liquid helper&lt;/a&gt;, any additional scripts or pixels that you may be firing in the &lt;a href=&quot;https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/add-conversion-tracking#tracking-pixels&quot;&gt;&lt;em&gt;Additional scripts&lt;/em&gt; section of Shopify checkout settings&lt;/a&gt; will also be ignored when using this impersonation mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test that your conversion scripts and/or Liquid variables are outputting correctly on the Order Confirmation page&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Testing conversion scripts and verifying the output of Liquid variables without placing a test order requires us to get a bit more creative, but it’s still a straightforward process.&lt;/p&gt;

&lt;p&gt;As an example, let’s imagine that you recently added an ad script or pixel that required you to pass through Order Total (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;) and Order Number (&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;To confirm that your Liquid tags will output the correct values when a customer hits the Order Confirmation page when they complete an order, you can output the values in a hidden div element on the page.&lt;/p&gt;

&lt;p&gt;The trick here is to add the snippet that you want to test in the &lt;em&gt;Scripts you want to run on every visit to confirmation page&lt;/em&gt; section of the confirmation scripts snippet.&lt;/p&gt;

&lt;!--kg-card-begin: html--&gt;
&lt;script src=&quot;https://gist.github.com/mattlebel/8d3db4c807334c61bed0558b85b723de.js&quot;&gt;&lt;/script&gt;
&lt;!--kg-card-end: html--&gt;

&lt;p&gt;Once these are added to the &lt;em&gt;Additional scripts&lt;/em&gt; section of the Checkout settings, you can use the method above (“Test what an Order Confirmation page looks like for a specific customer’s order”) to view the confirmation page. Hit “View Source” and do a “Command/Control + F” for the unique ID (“search-for-me” in the snippet above) to see the values that will be output by the Liquid tags you’ve provided.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/media/shopify-view-source-order-confirmation.png&quot; alt=&quot;Looking for the &amp;quot;search-for-me&amp;quot; string in the Order Status page's source code&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If the values are malformed or blank, it’s likely that you have a syntax error in your Liquid tag. If the values match what you expect, you can remove the testing snippet, save the updated &lt;em&gt;Additional scripts&lt;/em&gt; content, and you’re all set!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; An alternative method I learned from a colleague:&lt;/p&gt;

&lt;p&gt;Instead of using the approach above, you can use the following snippet to limit the scripts / pixel you want to test firing only when accessed with a specific customer (your test order email, etc.).&lt;/p&gt;

&lt;!--kg-card-begin: html--&gt;
&lt;script src=&quot;https://gist.github.com/mattlebel/3f4cfedb55628fd96776f9115be4df14.js&quot;&gt;&lt;/script&gt;
&lt;!--kg-card-end: html--&gt;

&lt;p&gt;&lt;strong&gt;Testing native Facebook + Google Analytics events:&lt;/strong&gt;  The exception to the above is when you want to verify purchase events fired by either the native Shopify Google Analytics Ecommerce integration or the native Shopify Facebook Pixel integration.&lt;/p&gt;

&lt;p&gt;Because those conversion pixels are fired outside of what’s editable in the &lt;em&gt;Additional scripts&lt;/em&gt; section of checkout, you’ll need to make a live test order to confirm.&lt;/p&gt;

&lt;p&gt;BTW, to get the most mileage out of your live test order, be sure that you have the &lt;a href=&quot;https://chrome.google.com/webstore/detail/facebook-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc&quot;&gt;Facebook Pixel Helper&lt;/a&gt; and &lt;a href=&quot;https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna&quot;&gt;Google Analytics Debugger&lt;/a&gt; Chrome extensions installed + activated before placing your test order.&lt;/p&gt;

&lt;h2 id=&quot;further-reading&quot;&gt;Further reading&lt;/h2&gt;

&lt;p&gt;If you’ve made it to the end of this post, you might also enjoy my other article on &lt;a href=&quot;/beyond-the-basics-with-google-analytics?track=shopify-confirmation&quot;&gt;Intermediate-level Google Analytics instrumentation + reporting&lt;/a&gt;.&lt;/p&gt;</content><author><name></name></author><category term="shopify-guides" /><summary type="html"></summary></entry></feed>