Form Builder

Tracking Forms with Google Tag Manager

Senest redigeret:

This article will guide you through the setup process for standard tracking in OnlineFundraising using Google Tag Manager (GTM). We will also explain how to handle consent to ensure that tracking is not sent if visitors have opted out in their cookie consent. This is achieved by making relevant data available in the data layer to GTM on all thank you pages where OnlineFundraising's receipt script is embedded. 



Before proceeding, please complete the following steps:

  1. Insert ContainerId for GTM in the settings in OnlineFundraising
  2. Add a Succes landing page for all purposes on all forms 
  3. Insert the OnlineFundraisings receipt/embed script on your landing page

Once these criteria are met, the data layer on the landing page will be populated with the following information: 

Key Example Data
of_agreement_frequency monthly
of_agreement_name Christians vej til kongressen
of_amount 1
of_currency DKK
of_data_set_guid e11d110e-9c3d-4aea-87ea-4872903a3ed9
of_form 8
of_oneoff no
of_payment_method Test
of_payment_session_guid bd7c66be-e309-49bc-8fe4-ffbcc157216c
of_payment_status success
of_payment_type payment
of_purpose_accounting_code pac2
of_purpose_name Christians vej til kongressen
of_vat 0


Additional Variable

It is possible to include one optional data point from the form by inserting a field in the form with the following reference:


In doing so, the following data is available in the data layer as well:

of_datalayer_var_1 (Data from the datalayer_var_1 field)

Setting up GTM

The above data alone does not provide any tracking, but it allows you to set up GTM precisely as desired – for instance, for Google Analytics 4 and Facebook Pixel. At the bottom of this article, you will find an attachment with an export of a container that uses the above variables to set up event and eCommerce tracking in Google Analytics and Facebook Pixel.

You will need to insert your own values in the following variables:

  1. Google Analytics Tracking_ID
  2. Facebook Pixel ID

"Abandon Cart"

With OnlineFundraising Google Analytics tracking, you have been able to get event and page views when a donor submitted the form but had not yet completed the payment. This can be used for remarketing to donors who were close to donating but did not complete the payment.

As tracking now only occurs upon success, this nuance is lost. Unfortunately, there is not much that can be done about this at the moment, as browsers are competing to tighten cross-domain tracking the most.

Alternatively, you can consider donors who land on the campaign page but do not complete a payment as "abandon cart".


See our webinar (in Danish) for in-depth walkthrough of tracking with GTM and Facebook Conversion API.

Learn more about

  • Preparing OnlineFundraising for tracking
  • Setup of Google Tag Manager such that events, transactions and page views are sent correctly to Google and Facebook
  • Configuring Facebook Conversion API and customisation of your existing Pixel to avoid duplicates
  • How to test your Tag Manager configuration

Was this article helpful?

0 out of 0 found this helpful