Tracking user behavior and data on your site is imperative to running a successful digital business. Google Analytics is a free data analytics platform that lets you measure all kinds of data related to your web traffic and user behavior on your site, like time on site, bounce rate, ecommerce revenue, and even return on investment (ROI) when it comes to your digital ads. Because of its robust features and comprehensive data collection, it’s the most widely used service of its kind. However, before you can reap the rewards of this powerful platform, you must first properly set it up. The most important (and complicated) step in this process is placing a pixel (defined below) on your site.This step-by-step tutorial will help you launch your tracking by guiding you through the process of placing the pixel on a WordPress or Shopify site.
- Script: A scripting or script language is a programming language that supports scripts: programs written for a special run-time environment that automates the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled).
- Plugins: Some plugins help in pixel placement. For WordPress, the header footer scripts plugin comes in very handy because it allows you to place pixels/scripts on individual pages, like thank you pages.
- Events: Events are specific codes placed to track specific page activities. For example, you could track add to carts, leads, checkout started, checkout completed and more.
Step 1 – Generate Your Pixel:
For this Google Analytics pixel tutorial, we will use be using a test pixel. To find to your pixel, log into your Google Analytics account, set up the account using Google’s setup wizard, and generate the code. You should get the code on one of your final screens.
Your tracking ID should look something like this: UA-44148842-1
Your pixel should look something like this:
<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-44138842-1″></script>
window.dataLayer = window.dataLayer || ;
gtag(‘js’, new Date());
Step 2 – Place the Pixel:
For WordPress, you will need to place your base pixel in the header of your site. Log into your WordPress backend and locate your header file (Appearance > Editor >header.php). Next, find the closing </head> and paste your pixel above that line (see below):
On Shopify, it’s a bit easier. Simply add it to your online store preferences, shown below:
Step 3 – Test Your Pixel:
The easiest way to test your pixel is to simply check to see if GA has registered any traffic for your site!You can also go to builtwith.com, enter your URL and scroll down to Advertising. You should see Google Analytics there if your pixel was placed properly.