ActionTag integrates with Google Tag Manager Event tracking to give you a more complete understanding of how supporters are interacting with your forms. This integration is available on all form and page types.
If you use Google Tag Manager, you may enter the property (GTM-XXXXXX) on the Basics step of a form or page. This will load gtag.js, send ActionTag events and let you use the {{GoogleAnalyticsId}} merge field in your themes. Alternately, you can add GTM code directly to a theme. For more on GTM configuration for Google Analytics 4, see Google's documentation.
Google Analytics Events
This is the data that will be passed to Google Analytics via Google Tag Manager upon successful integration.
Event | Trigger | eventCategory | eventAction | eventLabel | eventValue |
---|---|---|---|---|---|
Form loaded | postRender callback | ActionTag form type, e.g. Contribution, Petition | Form Load | Form Template | Number of fields in the form |
Form fill | postFill callback | ActionTag form type, e.g. Contribution, Petition | Form Fill | Form fill source, identical to the value of fill_source during alterFill, e.g. FastAction | Number of fields filled |
Form submitted | preSegue callback | ActionTag form type, e.g. Contribution, Petition | Form Submit | Submit Button text, e.g. Contribute, Donate | For ActionTag forms of type Contribution or Event, the monetary amount paid |
Form abandoned | window.onbeforeunload event | ActionTag form type, e.g. Contribution, Petition | Form Abandoned | Last field focused on (using the name assigned to the input element), e.g. SelectAmount, FirstName | Number of fields completed |
Captcha called | form submission (except Smart Links) | ActionTag form type, e.g. Contribution, Petition | Captcha Called | Google Recaptcha v2 Invisible | (null) |
Additional dataLayer Variables
In addition to eventCategory, eventAction, eventLabel, and eventValue, the following variables are sent to the Google Tag Manager dataLayer when each event fires.
Field | Value |
---|---|
sourceCodeId | The source code that will be applied to the person who submits this form - retrieved from the query string parameter if present, or from the form definition if not present in the query string |
activistCodes | An array of activist code IDs that will be applied to the person who submits the form |
tenantUri | A unique string relating to the committee that the form is associated with |
formName | The form name selected during the creation process |
formShortCode | A unique identifier that can be utilized to search for the form inside Online Actions |
Legacy Example for GTM in Universal Analytics
The following object provides an example of data that would be passed into the Google Tag Manager DataLayer when a Contribution form is loaded.
{
event: 'FormEvent',
eventCategory: 'ContributionForm',
eventAction: 'Form Load',
eventLabel: 'Minimal',
eventValue: 12,
activistCodes: ['3456','8901'],
sourceCodeId: 2345,
tenantUri: 'ngpvan://van/EA/EA001/1/2',
formShortCode: 'OQbID4vGGESISlTSrmpTsw2'
}