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:
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.
Connecting to Google Tag Manager
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 Meta Pixels expect.
Enhanced Conversions
When configuring your GTM connection, you can optionally enable Google's Enhanced Conversions setting. When enhanced conversions are enabled, ControlShift will include a user's email address in the Google Tag Manager data layer. The user's email address can then be sent to the tools that you've connected to within GTM. Google advertises enhanced conversions as a way of "improv[ing] the accuracy of your conversion measurement ... [and] improv[ing] bidding optimisation through better data." More information on enhanced conversions is available in Google's help center.
Tracking Petition Signatures as Meta Pixel Lead Conversions
Meta Ads can be a great option for organizations to grow their campaigns by advertising petitions to audiences on Facebook. Once Meta 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 Meta Business and Ads manager through the guides on the Meta 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 Meta 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 Meta Business Suite, go to Advertise > Events Manager. From there, click an existing data source or create a new one.
- Under Active Integrations, click to Manage Integrations. Either select a pixel or create a new one. (If creating a new integration, choose the Meta Pixel option.)
- Next click to Manually add Pixel code to website and 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 Some Custom Events. Then choose Event > Equals > Signed Petition.
- Save the Trigger
Next, map the new Signed Petition
trigger onto Meta “Lead Conversion” events. This mapping converts a ControlShift specific event into a format that Meta 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 Meta 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 All ControlShift Custom Events into Meta
If you'd like all ControlShift events to be sent to Facebook, that's an option too. In Google Tag Manager, you'll need to create a new Tag.
- Name your new tag appropriately. In Tag Configuration choose Custom HTML. Copy the pixel code from Meta and paste it into the text box. Where the pixel code shows
fbq('track', 'Lead');
, replace it withfbq('track', '{{Event}}');
.
In Advanced Settings > Tag Firing Options, choose Once per event. - In the triggering section, choose Custom Event. In the event name, check Use regex matching and
.*
for the name. Then choose the Some Custom Events option and enable settings for Event does not start with gtm. - Click to Save.
- Publish your new container.
Mapping a specific ControlShift Custom Event to a Meta Custom Event
Finally, if you only want to track one or some ControlShift events and want to track them as custom Meta events (not Leads). That's possible too.
- Name your new tag appropriately. In Tag Configuration choose Custom HTML. Copy the pixel code from Meta and paste it into the text box. Where the pixel code shows
fbq('track', 'Lead');
, replace it withfbq('track', '[NAME OF YOUR CUSTOM EVENT]');
In Advanced Settings > Tag Firing Options, choose Once per event. - In the Trigger Configuration section, chose the Custom Event option. Add the name of the ControlShift custom event (e.g.
Signed Petition
) as the Event Name. Please note that the event name should match exactly, including case and spacing. -
Under This trigger fires on choose Some Custom Events. Then choose Event > Equals > [Name of the ControlShift custom event] (e.g.
Signed Petition
). Please note that the event name should match exactly, including case and spacing. - Save the Trigger.
- Publish your workspace.
Meta Ads Using Custom Events
Once you've configured ControlShift and GTM to send events to Meta, you can use the events to create Custom Conversions. Those Custom Conversions can then be used as Custom Conversion Events for ads purposes.
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 All Custom Events.
- 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.