Setting up Google Analytics for TargetX Events
Note: These instructions cover setting up Basic Page Tracking with Google Analytics. For more advanced tracking, consult Google Analytics Support.
To configure Google Analytics for your Event Registration Forms, see Google Analytics for WebForms.
Step 1: Obtain a Google Analytics Tracking Code
Step 2: Configure Events Custom Code
- Login to your Salesforce Org and navigate to the Events Custom Code tab.
- Click the Theme Name used for your Events site.
- Select Edit.
- Add the following code to the javaScript field (Replace YOUR GA TRACKING ID with your Google Analytics Tracking ID):
</script><!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=YOUR GA TRACKING ID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'YOUR GA TRACKING ID');
- Save your changes.
Step 3: Configure/Validate Events Settings
- Navigate to Setup and search for Custom Settings.
- Select Manage next to Events Settings.
- Click Edit next to the custom setting to which you'd like to apply the CSS or Javascript.
- Confirm that the exact name of the custom code record you updated above is in the Template Override field.
- Click Save.