Setting Up Sitecore Send Form Analytics in Google Analytics 4

January 25, 2023

By Theresa Gutierrez

Intelligent Email Marketing with Sitecore Send

Sitecore Send is a powerful email marketing platform that allows marketers to manage, scale, and automate their email campaigns. Creating meaningful email campaigns is easier than ever, with Sitecore Send’s modern no-code editing experience, customizable templates, and comprehensive analytics. It also has powerful AI-based segmentation tools that dynamically tag subscriber lists based on website behaviour and customer preferences. Simple integrations make it easy to create a unified marketing strategy that combines email newsletter campaigns with other channels. These features make it an ideal choice for businesses looking to launching successful email newsletter campaigns using a SaaS-based platform.

Setting Up Sitecore Send Form Analytics in GA4

The powerful real-time analytics in Sitecore Send allow marketers to optimize every campaign with live data and advanced analytics. But there is one metric that Sitecore Send doesn’t provide, and that’s measuring which pages subscribers are opting into our campaigns, and which pages referred them. Once we have a newsletter campaign ready to launch in Sitecore Send it would be beneficial to look at setting up your form analytics for Sitecore Send in Google Analytics 4 (GA4).

Understanding where your subscribers are coming from, will help measure the effectiveness of your campaigns and determine which platforms of promotion are the most successful. In this blog post, we’ll cover how to set up form signup tracking for a Sitecore Send newsletter campaign in GA4 using Google Tag Manager (GTM).

How it Works

The diagram below outlines the GTM container we have installed on our website along with our Sitecore Send signup form. This information is tracked using a GA4 Configuration and GA4 Event tag configured in GTM, which passes analytics data to our data stream in GA4 for our Event reporting.

Diagram of Sitecore Send including GTM and GA4 

Using GA4 & GTM to Track Sitecore Send Signups

Before we jump into the specifics, let’s just ensure your GA4 property is configured. In case you weren’t aware, Google plans to sunset its Universal Analytics platform after June 30, 2023. Read our blog on Setting up Google Analytics 4, if you still have to configure your GA4 property.

GA4’s enhanced measurement allows for default event tracking, including form interactions, but it doesn’t cover all possible scenarios. Therefore, we’re going to show you how to track more specific and nuanced GA4 events using GTM.

The specific event we want to track is when a website visitor fills out our Sitecore Send form and subscribes to our website. Below is a screenshot of what our Sitecore Send form looks like:

Sitecore Snack form example of getfishtank.com 

There are a few different ways we can set up form submission events in GA4 using GTM. Our previous blog focuses on using GTM’s built-in form submission trigger, but this configuration will take a different approach. This Sitecore Send form is embedded on our website using JavaScript. Instead, we will track the click event when visitors select the Subscribe button to join Fishtank’s Sitecore Snack newsletter. Although GA4 can automatically track outbound link clicks and file downloads using enhanced measurement, we will focus on setting up other click events using GTM’s click trigger.

Click Triggers in Google Tag Manager

There are two types of built-in click triggers in GTM:

  • All elements — tracks clicks of any elements on the website (i.e. links, images, buttons, etc.)
  • Just links — tracks only link clicks
Screenshot of GTM click trigger types 

Before configuring the tag in GTM, we need to determine what our click trigger needs to listen to. By using the GTM Preview and Debug mode, we can be more precise about what information is being pushed to the data layer on our website. In

Step 1: Click the Preview button in your GTM dashboard:

Screenshot of GTM Preview mode 

Step 2: Enter the URL for the site we will be tracking:

Screenshot of GTM preview debug mode 

Step 3: Navigate to the Sitecore Send form you want to track and submit a test by filling out the form and clicking the Subscribe button:

  Screenshot of Sitecore Snack form submitted 

Before clicking the subscribe button, I like to clear the data in my Tag Assistant window, so that we can see exactly what happens in the data layer of our website when we click the Subscribe button. To do this, click the garbage can icon next to Summary in the left menu:

Screenshot of GTM Preview mode  

Step 4: Submit the form and return to the Tag Assistant window. Here we can view the API Call that occurred on our website after clicking Subscribe. Click the drop-down arrow under the API Call section:

Screenshot of GTM preview debug mode 

Here is a screenshot of the API Call for our Subscribe button. We can see that there is a gtm.elementClasses in the dataLayer called moosend-designer-button. We can use this as a Click Class in our Subscribe button trigger. Tim

Screenshot of GTM Preview Datalayer code 

Setting Up a Click Tag in Google Tag Manager

Now that we know how to classify our Subscribe button for our trigger, let’s set it up in GTM.

Step 1: Go to the GTM container that is connected to the GA4 property you want to use to track Sitecore Send signups.

Step 2: Navigate to the Variables tab in the left-side menu:

Screenshot of GTM Variables menu  

Step 3: In the Built-In Variables section, click Configure. The following list will appear. Enable all of the click-related built-in variables. Click the ‘X’ to close the pop-up:

 Screenshot of GTM list of built-in variables 

Step 4: Go to the Triggers tab in the left-side menu and click New:

Screenshot of GTM Trigger menu  

Step 5: Name your new trigger, and click the Trigger Configuration section to choose a trigger type. Select the Click - All Elements trigger type:

Screenshot of GTM Trigger configuration  

Step 6: To specify the Subscribe button on our Sitecore Send newsletter form, we want to indicate that this trigger fires on Some Clicks. After our click test using the Preview mode, we know to use the following condition: Click Class contains moosend-designer-button. Click Save:

Screenshot of GTM Trigger configuration  

Step 7: Next, we need to connect our new trigger to a GA4 Event. Navigate to the Tags tab in the left menu:

Screenshot of GTM Tag menu  

Step 8: Click New and name your new tag. For the purpose of this example, we named it: GA4 Event - Newsletter Form Submission. Click the Tag Configuration section and select the Google Analytics: GA4 Event tag type:

Screenshot of GTM Tag types  

Step 9: Select your GA4 Configuration Tag and name your Event. Click the Firing Triggers section and select the Subscribe Button trigger we created earlier:

Screenshot of GTM Tag configuration  

Step 10: Final step is to test! Refresh the GTM Preview mode and click the Preview button again to test our new GA4 tag:

Screenshot of GTM preview debug mode 

Step 11: One way we can double-check our newsletter signup event is populating properly in GA4, is by using the Realtime Report (under the Reports tab in the left menu). Check the Event Count card at the bottom of the reporting dashboard:

Screenshot of GA4 realtime report 

Configuring Custom Dimensions for Form Tracking

The last step to configuring our signup tracking for our Sitecore Send newsletter is to create Custom Dimensions for our reporting. We want to be able to track which pages people subscribed to our newsletter (page_location) and where they came from (page_referrer). In order to use these parameters in our reporting, we must first create them as Custom Dimensions.

Step 1: Navigate to the Admin settings in the left-side menu in GA4, where you will see the following account and property settings:

Screenshot of the Admin Custom Definitions screen 

Step 2: Under the property column, click Custom Definitions. Navigate to the Create custom dimensions button in the top right.

Screenshot of GA4 custom definitions

Screenshot of GA4 new custom definitions  

Step 3: We will create two new custom dimensions with the following information:

Dimension Name Description Event Parameter
page_location The full URL of the page view page_location
page_referrer Webpage that sends visitors to your site using a link page_referrer

After setting up each custom dimension, click Save.

Here are the two new custom dimensions we created for our event reporting.

Screenshot of GA4 custom definitions  

Step 4: In our reports, click the ‘+’ next to the first column to see a drop-down of the custom dimensions we just created. Here we can add them to the report to give us more insight into our newsletter signup tracking.

Screenshot of GA4 secondary dimensions 

In Closing

Using GA4 in connection with our Sitecore Send campaigns will help us track newsletter signups across our website. By implementing event tags with GTM, we can gain detailed insights into which pages users are signing up on, and where they are coming from. Measuring the success of your Sitecore Send campaigns with GA4 will give us a deeper understanding of what is most effective for promotion in real-time. If you need more help with Sitecore Send, Google Analytics 4, or Google Tag Manager, feel free to reach out to our friendly team at [email protected]. Until then, happy tracking!



Theresa

Theresa Gutierrez

Sitecore Strategist | Sitecore Strategy MVP

Theresa, aka 'T', is a high-energy marketing creative with 8+ years of experience across various industries. She's passionate about delivering strategy and design, with a focus on Sitecore SaaS technologies. T is an avid golfer and loving dog momma, appeased only by delicious food and a bevy of something bubbly. Cheers!