Google Tag Manager Event Tracking

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.

EventTriggereventCategoryeventActioneventLabeleventValue
Form loadedpostRender callbackActionTag form type, e.g. Contribution, PetitionForm LoadForm TemplateNumber of fields in the form
Form fillpostFill callbackActionTag form type, e.g. Contribution, PetitionForm FillForm fill source, identical to the value of fill_source during alterFill, e.g. FastActionNumber of fields filled
Form submittedpreSegue callbackActionTag form type, e.g. Contribution, PetitionForm SubmitSubmit Button text, e.g. Contribute, DonateFor ActionTag forms of type Contribution or Event, the monetary amount paid
Form abandonedwindow.onbeforeunload eventActionTag form type, e.g. Contribution, PetitionForm AbandonedLast field focused on (using the name assigned to the input element), e.g. SelectAmount, FirstNameNumber of fields completed
Captcha calledform submission (except Smart Links)ActionTag form type, e.g. Contribution, PetitionCaptcha CalledGoogle 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.

FieldValue
sourceCodeIdThe 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
activistCodesAn array of activist code IDs that will be applied to the person who submits the form
tenantUriA unique string relating to the committee that the form is associated with
formNameThe form name selected during the creation process
formShortCodeA 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'
  }