- 26 Feb 2026
- Print
- DarkLight
- PDF
Embedding Google Analytics and Conversion Tracking
- Updated 26 Feb 2026
- Print
- DarkLight
- PDF
Slate fully supports Google Analytics and other analytics platforms with JavaScript APIs for registering page views and conversion events.
Tracking code
Most analytics platforms include JavaScript that can be embedded on a page to register the page view. These scripts set a persistent cookie that may be used to track the viewer from one webpage to another, and through browsing sessions.
Most analytics platforms will provide code that looks like the following Google Analytics tracking code:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXX');
</script>When evaluating the code for inclusion, first confirm that the code does not contain any calls to document.write. If you see anything like document.write, you should avoid including this code, as this is likely old tracking code and is not intended to work with modern browsers and platforms.
Once you have prepared the tracking code, you can embed this code in your institutional branding.
Conversion code
Many analytics platforms, including Google Analytics and Google AdWords, provide the capability to register "conversion events" based on certain user actions. These may include starting or submitting an application, or submitting a request for information form. For example, you may have a Google AdWord that directs users to a landing page with a call to action to sign up for your mailing list. To gauge the efficacy of these advertisements and to take advantage of Google AdWords’ built-in optimization capabilities, you may want to embed specific conversion code based on an event, such as signing up for the mailing list.
First, you will need to create the conversion code. In Google Analytics 4, you may receive a script that looks like the following to track conversion events:
<script>
gtag('event', 'EVENT_NAME', {
'parameter_name': 'parameter_value',
'another_parameter': 'another_value'
});
</script>Triggers
You must identify the event in Slate that triggers this action. If, for example, you want the conversion event to fire when a respondent submits a form, you can create a custom "Confirmation Page" onto which this code can be embedded.
When you access the form through the administrative system in Slate, you can click the "Communications" button to retrieve the list of configured communications, including upon registration emails that may be sent. If you want the same message to be emailed and shown in the browser, you can create or edit any existing "upon registration" communication. You can also, if desired, create a custom "confirm page only" communication.
Embedding the Code in Communications
Select Source in the toolbar. Paste the conversion code that you have above the closing </head> tag in the message.

You may receive a warning message about script tags when you add this code to your confirmation page. You can ignore this as long as your communication is set to Confirmation Page Only, as the warning message is only relevant for email communications.
That's it! Upon submitting the form, the confirmation page will be displayed, and the conversion code will be loaded and executed. These same techniques can be applied elsewhere throughout Slate, including in the online application, which is largely editable through the Application Editor.
Embedding the code in the form description
You can also track when someone accesses the form.
You can add the Facebook pixel code to the form's description, just before the closing </head> tag in the source code:

