How to Track Thinkific Purchases with Google Analytics 4 (GA4) Using Google Tag Manager (GTM)

This guide will help Thinkific Course Creators measure which traffic sources are leading to sales, by tracking purchases with Google Analytics 4 (GA4), so they can optimise their marketing.
While Thinkific has an integration with Google Analytics 4, it only tracks page views and does not track sign-ups nor e-commerce events such as purchases. To get theses other events into GA4, Google Tag Manager (GTM) is needed.

Install Google Tag Manager in Thinkific

If your are not yet using Google Tag Manager on your Thinkific site, this section will guide you through its implementation.

Google Tag Manager is a tag management system that allows you to quickly and easily setup measurement codes (tags) on you website such as GA4, Meta Pixel, Google Ads Conversions, etc.

Create a Google Tag Manager Account if You Don’t Have one

If you do not have a Google Tag Manager account, you will need a Google Account, such as a GMail or Google Workspace, to create one.
Go to https://tagmanager.google.com/
If you are not already logged in the browser with a Google Account, you will be prompted to sign in with one. Once signed in, click the Create Account button to the top right.

Click the Create Account button

On the next screen:

  • Enter and Account Name (it can be anything you like).
  • select your Country.
  • Enter a Container name (it can be anything but typically it is the website the container is related to).
  • Choose Web for Target platform.
  • Click the Create button.
Add New GTM Account Details

Click Yes to accept the Terms of service.

Click Yes to accept GTM Term of Service

You will then be presented with the code to be added to Thinkific.

Add Google Tag Manager to Thinkific Theme Code

Copy the GTM <head> code

Copy GTM Head Code

Login to the Admin area of your Thinkific account.

  • Go to DESIGN YOUR SITE > Theme Library.
  • To the right of the BUILD button on your theme, click the three dots, then click EDIT CODE.
Select edit code in Thinkific Them library

Click Layouts > default.

Select default layout in Thinkific Theme

Paste the GTM code to the top of the head tag:

  • Look for the opening <head> tag.
  • Put you cursor after the > of the tag.
  • Press enter to create a new line.
  • Paste the GTM code that was previously copied.
Animated gif showing adding GTM head code to Thinkific theme

Go back to GTM and copy the body code.

Copy GTM body code

Past the GTM code to the top of the <body> tag:

  • Look for the opening <body> tag.
  • Put you cursor after the > of the tag.
  • Press enter to create a new line.
  • Paste the GTM code that was previously copied.
  • Click the SAVE button to the top right.
Animated gif showing adding GTM body code to Thinkific theme

Publish Empty GTM Container

Publish the empty GTM container in order to avoid issues that may occur when trying to test an unpublished container.

Click Submit button in Google Tag Manager
  • Enter a Version Name (eg Empty Container).
  • Click the Publish button to the top right.
Click Publish button to publish the GTM container

What is the Data Layer?

The Data Layer is a place where you can put information about your website while the user interacts with your site. If the user visits a particular page, information about that page can be put in the Data Layer. In this guide, we are going to put information about Purchases and Sing-Up in the Data Layer.
Google Tag Manager detects when information is put into the Data Layer and can use it Triggers that then fires Tags and other things.

Add Purchase Event Data Layer to Thinkific

Go to Settings > Code & analytics

Go to Settings then Code & analytics

Copy the code below

<!-- GA4 Data Layer purchase event -->
<script>
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
  window.dataLayer.push({
    event: "purchase",
    ecommerce: {
      transaction_id: "{{order_number}}",
      value: {{total_price}},
      currency: "USD",
      items: [
        {
          item_id: "{{product_id}}",
          item_name: "{{product_name}}",
          price: {{total_price}},
          quantity: 1,
          affiliation: "{{referral_code}}"
        }
      ]
    }
  });
</script>
<!-- End GA4 Data Layer purchase event -->

In the Order tracking code section, paste the code and then click the SAVE button.

Paste and save order tracking code

Add Sign-Up Event Data Layer to Thinkific

Copy the code below.

<!-- GA4 Data Layer sign-up event -->
<script>
  window.dataLayer = window.dataLayer || [];
  dataLayer.push({
    event: 'sign_up',
    user_id: '{{id}}'
  });
</script>
<!-- End GA4 Data Layer sign-up event -->

In the Signup tracking code section, paste the code and then click the SAVE button.

Paste and save signup tracking code

Add GA4 Configuration (Google) Tag to GTM

Get GA4 Measurement ID

In GA4, go to Admin > Data Streams then click on appropriate data stream (hopefully there is only one)

Select your data stream

Copy the Measurement ID

Copy measurement ID

Create a Constant Variable for the Measurement ID

In GTM create a constant variable for the Measurement ID. Go to Variables and click the New button.

Click variables then new

Click Variable Configuration and select Constant in the Utilities section.

Click variable configuration
Select Constant from Utilities secction

Paste the Measurement ID in the Value field. Give the variable an name and then click the Save button.

Enter measurement ID, name then save

Create Google Tag

  • Select Tags from the left menu.
  • Click New > Tag Configuration > Google Analytics > Google Tag.
  • To insert a variable, click the grey icon (that look like a lego block) to the right of the Tag ID input field.
  • Select the Measurement ID constant variable created previously.
Animated gif showing selecting Google Tag
  • Click Configuration settings to reveal its options.
  • Click the Add parameter button.
  • Enter send_page_view in the Configuration Parameter field and false for the Value field.
Set send_page_view to false
  • Scroll to the bottom and click Triggering
  • Select All Pages
Animated gif showing selecting All Pages trigger for triggering

Enter a name and then click the Save button

Enter tag name then save

Create Data Layer Variables

Needed to get non ecommerce parameters from the data layer.

Create Data Layer Variables for Sign-Up Parameters

  • Go to Variables > New > Variable Configuration
  • In the Page Variables section click Data Layer Variable
Select Data Layer Variable
  • Enter user_id in the Data Layer Variable Name field.
  • Enter a name for the the variable (eg. DLV data_layer_variable_name).
  • Click the Save button.
Enter Data Layer Variable Name, name the variable then click save button

Create GTM Triggers

Purchase Trigger

Starting from the left menu:

  • Click Triggers > New > Tag Configuration.
  • Scroll to the Other section and click Custom Event.
Animated gif showing setting custom event for Trigger Configuration
  • Enter purchase in the Event Name field.
  • Enter a name for the tirgger (that makes it clear what it is).
  • Then click the Save button to top right.
Enter purchase as event name, name tag then save

Sign-Up Trigger

  • Click Triggers > New > Tag Configuration.
  • Scroll to the Other section and click Custom Event.
  • Enter sign_up in the Event Name field.
  • Enter a name for the tirgger (that makes it clear what it is).
  • Then click the Save button to top right.
Enter sign_up as event name, name tag then save

Create GTM Event Tags

Create Page View Event Tag

Starting from the left menu:

  • Click Tags > New > Tag Configuration > Google Analytics > Google Analytics: GA4 Event.
  • To insert a variable, click the grey icon (that looks like a lego block) to the right of the Measurement ID field.
  • Click the Measurement ID constant variable previously created.
  • Enter page_view in the Event Name field.
  • Go to the bottom of the screen and click Triggering > All Pages.
Animated gif showing creating and configuring page_view GA4 event tag
  • Enter a name for the Event (for GA4 events (eg. ‘GA4 Event name_of_the_event’).
  • Then click the Save button to top right.
Name and save page_view GA4 event tag

Create Purchase Event Tag

Ensure still on the Tags screen then:

  • New > Tag Configuration > Google Analytics > Google Analytics: GA4 Event.
  • To insert a variable, click the grey icon (that looks like a lego block) to the right of the Measurement ID field.
  • Click the Measurement ID constant variable previously created.
Animated gif showing creating GA4 event tag and adding measurement ID
  • Enter purchase in the Event Name field.
  • Click on More Settings to reveal its options.
  • Check the Send Ecommerce data checkbox.
  • Ensure Data Layer is selected from the Data source dropdown.
Enter purchase as Event Name and configure Send Ecommerce data from Data Layer
  • Go to the bottom of the screen and click Triggering.
  • Select the purchase trigger created previously.
Select purchase custom event
  • Enter a name for the Event.
  • Then click the Save button to top right.
Give purchase event tag a name and save

Create Sign-Up Event Tag

Ensure still on the Tags screen then:

  • New > Tag Configuration > Google Analytics > Google Analytics: GA4 Event.
  • To insert a variable, click the grey icon (that looks like a lego block) to the right of the Measurement ID field.
  • Click the Measurement ID constant variable previously created.
  • Enter sign_up in the Event Name field.
Configure GA4 sign_up event with Measurement ID and Even Name
  • Click Event Parameters to see its options
  • Click Add Parameter
  • Enter user_id in the Event Parameter field
  • To insert a variable, click the grey icon (that looks like a lego block) to the right of the Value field.
  • Select the user_id data layer variable created previously.
Animated gif showing adding user_id event parameter
  • Go to the bottom of the screen and click Triggering.
  • Select the sign_up trigger created previously.
  • Enter a name for the Event.
  • Then click the Save button to top right.

Test GTM Setup

Have GA4 open on a tab and go to the DebugView:

  • Admin > DebugView
Select DebugView from Admin section in GA4

Go to GTM and click the Preview button to start preview mode.

Click Preview button in GTM

Tag Assistant will open:

  • Enter the URL of your Thinkific site in the Websites URL field.
  • Click Connect
Enter Your Website URL and click the Connect button

Your website should open in a new tab:

  • Begin a purchase transaction on your Thinkific site (you can use a coupon to zero the cost)
  • When the button to complete the order is clicked and the account setup screen loads, check Tag Assistant for the sign_up event.
Click sign_up event in preview mode and see GA4 event tag fired for sign_up

Check debug screen in GA4 for the sign_up event

sign_up event in GA4 debug view

After credentials have bee submitted and the Thank You page loads.

  • Check Tag Assistant for the purchase event.
  • Check GA4 debug view for the purchase event.
Click purchase event in preview mode and see GA4 event tag fired for purchase

Switch From Thinkific GA4 App to GA4 Via GTM

Uninstall GA4 up in Thinkific

  • Click INTEGRATIONS
  • click the red trash can icon to Uninstall GA4
Click delete button to uninstall GA4 in Thinkific

Publish the GTM container:

  • Click Submit to the top right.
  • Enter a Version Name
  • Enter a Version Description
  • Click the Publish button.
Enter Version Name, Version Description and click Publish button to publish GTM container

Which Traffic Sources Are Leading to Sales?

Now that measurement is in place, the next step would be to wait till you are certain you have some sales. The data won’t be in the reports right away though, so at minimum wait till the following day to check (it could take as much as 48 hours). Then go to:

  • Reports > Acquisition > Traffic acquisition.
Go to Traffic acquisition in GA4 reports

This report shows Traffic source by Sessions, and by default the left most column in Session default channel group. If you desire to see things broken down UTMs Session source / medium instead, go to:

  • Click the Session default channel group heading.
  • Select Session source / medium.
Animated gif showing selecting Session source / medium

You can also click the arrow in the heading of the Total revenue column to sort the column in descending order so you can see your traffic sources from highest to lowest sales.
The plus symbol to the right of heading of the first columns alloys you to add a second dimension. Eg. you can add Session campaign to evaluate if you have proper UTMs setup for your traffic sources (et. paid ad campaigns, etc.).

Click down arrow to sort by total revenue

Gotchas

GTM Does Not Fire On The Checkout Page – A Thank You Page is Needed

Google Tag Manager does not load on the Checkout Page. Instead, for the purchase flow, the sign_up event happens on the screen after the checkout page where credentials are entered, while the purchase event happens on the Thank You page.
For things to work there must be a native Thinkific Thank You page in the flow. If this is missing, or there is a totally custom thank you page, it will not work.

GA4 Has a 24 to 48 Hour Processing Time

GA4 has a processing time of 24 to 48 hours. Therefore you may not see any data in the reports until that time period has elapsed. Usually data will show up the following day, but when troubleshooting the reports be sure to exclude the most recent 48 hours.

Leave a Comment

Your email address will not be published. Required fields are marked *