Be sure to use Google Tag Manager securely
If you’re subject to the EU GDPR, you’ll need to evaluate the compliance of Google Tag Manager separately from your Data Processing Agreement with us. Google Tag Manager is not an authorized GDPR subprocessor under our agreement with you.
Looking for something specific? Skip ahead:
Tracking Petition Signatures as Facebook Pixel Lead Conversions | Tracking ControlShift Petition Signatures as Google Analytics v4 Custom Events |
Google Tag Manager (GTM) is a free and powerful Tag Management System that allows your team to connect ControlShift with a wide variety of third-party analytics and advertising tools, even those that are not officially supported by Google.
If you’re new to Google Tag Manager, we’d recommend starting with this quick overview from the Google team.
To get started with Google Tag Manager on ControlShift the first step is to create a GTM Workspace for your ControlShift instance and then link it with your ControlShift Platform
- Create a new Container for your ControlShift platform in your Google Tag Manager account. Each container has an identifier in a format like
GTM-ABC123
. - Give the Container a name that will help you remember it.
- For Target Platform select Web
- When presented with the code to “Install Tag Manager” in a modal, you can skip this step. All that is necessary to setup Google Tag Manager with ControlShift is your new container’s ID in the format
GTM-ABC123
. - Copy the GTM Container ID from the GTM managed and add your Container ID within the admin area of your ControlShift Platform via Settings > Integrations > Google Tag Manager.
- Save the GTM Integration in ControlShift.
Now that you’ve linked ControlShift and GTM you’re ready to set up GTM Tags for advertising and analytics services and GTM Triggers to map the Google Tag Manager dataLayer events that we publish within ControlShift when the GTM Integration is set up to the native events that services like Google Adwords or Facebook Pixels expect.
Tracking Petition Signatures as Facebook Pixel Lead Conversions
Facebook Ads can be a great option for organizations to grow their campaigns by advertising petitions to audiences on Facebook. Once Facebook Pixel Events are linked up via Google Tag Manager to ControlShift it is possible to track the return on investment for each Facebook advertisement, learn how many new supporters have been recruited, measure the performance of ads against each other, and measure the cost effectiveness of Facebook versus other advertising providers.
If you’re new to conversion tracking and attribution we’d recommend familiarizing yourself with the Facebook Business and Ads manager through the guides on the Facebook Business Help Center before getting started. The instructions here assume that you’ll be driving traffic to petitions and optimizing those ads for conversion on the ControlShift Platform rather than using Facebook Lead Ads for which conversion tracking is native to Facebook.
First install your Facebook Pixel within the Google Tag Manager Container for ControlShift.
- Log in to your Google Tag Manager account.
- Select your website's container and click Add a new tag.
- At the top of this page, enter a name for your tag.
- Click the Tag Configuration section and choose the Custom HTML Tag option.
- Within the Facebook Business Manager, select or create a Pixel.
- Go to the More Tools > Events Manager and select Add Events > From a New Website.
- Select Install code manually.
- Click Copy Code to copy the entire pixel base code.
- Return to Google Tag Manager and paste the code in the HTML container.
- Click to expand the Advanced Settings sections and select Once per page under Tag firing options.
- In the Triggering section, choose the All Pages option.
- Click to Save.
- Publish your new tag manager container.
Once these basic steps are complete, when your supporters browse your ControlShift Platform basic events for Page Views will be recorded.
Now, set up a Google Tag Manager Trigger that we'll use to map ControlShift dataLayer events to tags. When GTM is set up, we automatically fire a ControlShift-specific event into the Google Tag Manager dataLayer. For example, the Signed Petition event is fired each time a supporter signs a petition.
- In Google Tag Manager, select your website’s container > Triggers and click New
- Name this trigger
Signed Petition
. - In the Trigger Configuration section, chose the Custom Event option. Add
Signed Petition
as the Event Name. - Under This trigger fires on choose All custom events.
- Save the Trigger
Next, map the new Signed Petition
trigger onto Facebook “Lead Conversion” events. This mapping converts a ControlShift specific event into a format that Facebook understands and can interpret semantically, by adding a new tag that fires when triggered
- In Google Tag Manager, select your website's container and click Add a new tag.
- Name your tag something like ControlShift Petition Signature.
- In Tag Configuration, click Custom HTML Tag.
- Copy and paste the snippet of code
<script>fbq('track', 'Lead');</script>
. (You can also set a newly-named event instead ofLead
.) - .Under Advanced Settings, select Once per event under Tag firing options.
- Under Tag Sequencing check the box and select Fire a tag before ControlShift Petition Signature fires. Then choose your base code tag.
- Under Triggering, select the
Signed Petition
trigger created above. - Click to Save.
- Publish your new container.
When complete, your Tag listing with Google Tag Manager should look something like this:
Once published, there are a few tools that you can use to test that all of the data is flowing properly. Both the Facebook Pixel Events Manager and Google Tag Manager offer debug or preview tools that allow you to inspect the activity for a browser session and ensure that the tags you’d expect are firing correctly.
While these instructions are aimed at tracking the Signed Petition
event, the same process can be used for other automatically tracked ControlShift events.
Tracking ControlShift Petition Signatures as Google Analytics v4 Custom Events
Tracking petition signatures in Google Analytics allows deeper analysis, building on top of basic page views information offered by Google Analytics out of the box. Tracking petition signatures as custom events allows analysts to evaluate petition signature conversions, learn where petition signers arrive from, and discover how campaigns are performing when shared on various mediums.
First, set up the Google Analytics Tag for Page Views. This will ensure that basic page view data is flowing into Google Analytics
- Log in to your Google Tag Manager account.
- Select your website's container and click Add a new tag.
- Name you tag, and then click the Tag Configuration section. From there, choose Google Analytics: GA4 Configuration and enter the Google Analytics Measurement ID for the property.
- Click the Advanced Settings dropdown and select Once per page under Tag firing options.
- Under Triggering, select All Pages.
- Click to Save.
- Submit your workspace changes.
Next, map the custom Signed Petition
event from the ControlShift Google Tag Manager dataLayer into a custom event within Google Analytics.
- Log in to your Google Tag Manager account.
- Select your website's container and click Add a new tag.
- Enter a name for the new tag, and then click the Tag Configuration section. From there, choose Google Analytics: GA4 Event and enter
{{Event}}
as the Event Name. Under Configuration Tag choose the tag you set up in the previous step or choose the Manually Set ID option and enter your Google Analytics Measurement ID for your Google Analytics project. - Under Triggering, add a Trigger that will fire the tag. If the trigger for the event you’d like to use already exists, you can reuse it or follow these instructions:
- In Google Tag Manager, select your website’s container and navigate to Trigger > New.
- Name this trigger
Signed Petition
- Click into the Trigger Configuration section, and then choose Custom Event. Add
Signed Petition
as the Event Name. - Under This trigger fires on choose Some custom events, where Event equals Signed Petition.
- Save the Trigger.
- Submit your workspace changes.
- In the Google Analytics Realtime dashboard, you should begin to see the new custom event arrive.
Comments
0 comments
Please sign in to leave a comment.