The widgets from Afrus allow users of interest to organizations to perform actions. Therefore, it is necessary to accurately track what these users do.
One of the most widely used tools for this purpose is Google Tag Manager. Within the widget system, it is designed to automatically integrate tracking capabilities by simply adding the Google Tag Manager container ID (from now on referred to as GTM). Once integrated, the form will automatically start tracking and sending information to this platform for subsequent processing and specific use by organizations.
How do I integrate GTM into Widgets?
You only need to copy the GTM ID into the Global Settings > Advanced > Google Tag Manager section. This tracking code will facilitate the collection and sending of information for later processing.
This code follows the structure: GTM-XXXX
In Afrus, for each widget, the container ID must be provided and sent through the backend in the /form
endpoint so that it can be used by the widget after rendering.
For the data to be sent correctly, it must be executed through events, which are explained below:
Events
The following are the events for each widget goal, including their definitions and when they are executed:
Goal: Donation
Event | Definition | When it is executed |
"START" | Triggered when the widget is rendered, indicating that the form has been viewed. | Immediately after the widget is fully rendered. |
"ADD_TO_CART" | Triggered when selecting the amount and type of donation. | On the call to action of the payment data snippet. |
"GENERATE_LEAD" | Triggered when filling in the user's personal details and sending them as a lead. | Right after completing the personal details and clicking "Next." |
"BEGIN_CHECKOUT" | Indicates that the donation payment process has started. | Once the donor reaches the payment step. |
"ADD_PAYMENT_INFO" | Indicates that payment information has been entered. | After entering payment details and clicking the submit button. |
"PURCHASE" | Indicates that the donation payment was successfully processed. | Once a successful transaction response is received. |
Goal: Registration
Event | Definition | When it is executed |
"START" | Triggered when the widget is rendered, indicating it has been viewed. | Immediately after the widget is fully rendered. |
"REGISTER" | Indicates that the lead has been registered. | When the user is saved in the database. |
How to activate it in Afrus?
Go to your widget > Advanced > click on Google Tag Manager 4.
Enter the tracking code you previously configured in GTM4.