Facebook CAPI through GTM
Bridge your events in a seamless way.
Commanders Act provides a GTM template to connect your existing GTM implementation to our serverside endpoint, enabling "Facebook CAPI" in a secured environment.
Summarizing all recommended steps:
- 1.Add our template
- 2.Configure your tag
- 3.Update your Facebook tags
Click on "Tags".
(2)the "New" button.
Click on "New".
(3)the "Tag Configuration" area.
Click on the "Tag Configuration".
(4)the magnifying glass in the upper right corner.
Click on the magnifying glass.
(5)the "Commanders Act | Serverside events bridge" custom template and click on it to start the configuration.
Select our template "Commanders Act | Serverside events bridge".
Start by filling
(6)a name for your tag in the upper left corner.
Name your tag.
Hint: you may want to name your tag adding the event name you're going to implement in the end. (E.g. "Commanders Act | Serverside events bridge - Purchase")
(7)"Commanders Act Site ID" and select
(8)the "Commanders Act Event" from the drop-down menu, which is the event you want to forward.
Input your "Site ID" and select your "Event".
Depending on which event you select more (or less) fields will be presented. In case you don't input a mandatory field the template will highlight the missing entry so you can provide a proper mapping.
The "Event Fields" section contains fields that define the event itself and are mostly mandatory or highly recommended.
Events including the "Product Fields" section require an array structure for your product information. The first field will always be the
(9)base array where the information is stored and all subsequent fields are the related properties - E.g. you can map the information about
(10)the "Product Id" by filling the property name.
The section "Product Fields".
In the "User Fields" section you can set
(11)the "User Id" and
(12)"User Email" - Either one of them is required if you select the "Purchase" event. The
(13)"User Consent Categories" is a mandatory field holding an array with the user's consent category identifiers.
The section "User Fields".
It's important to define and map all category identifiers with their respective names. For example, you may have the following array: [1,2,4] and you defined the following relationship:
- 1 ➜ Advertising category
- 2 ➜ Analytics category
- 4 ➜ Functionality category
You also share with Commanders Act that the "Advertising category" must be enabled to activate the "Facebook CAPI." In this example, since the category identifier  is included in the array we can activate the bridge and forward the event to Facebook.
Ensure your category relationships are shared with Commanders Act.
Only with the agreed consent settings, we're allowed to bridge both the "Purchase" and "Refund" events to the "Facebook CAPI".
Complete your configuration by selecting the proper activation in the "Triggering" area / "Firing Triggers".
If you're planning to keep running your existing Facebook pixels while using "Facebook CAPI" through GTM, it's really important that you update them following these guidelines. This will allow to deduplicate and keep consistent measurements of your events.
The process is straightforward as for every event you're sending via pixel tags you just need to add the event identifier - On GTM, open your "Facebook Pixel" tag and expand
(14)"More Settings" to locate the "Event ID" and click
(15)its icon on the right.
The "More Settings" including the field "Event ID".
A new window will slide-in. Click on
(16)the plus on the top right.
Click on the plus to add a new variable.
(17)the "Variable Configuration".
Click on the "Variable Configuration".
(19)variable as window.tC.uniqueEventId and set the same name in
(20)the "Global Variable Name" then click
(21)the "Save" button.
Name your variable and the "Global Variable Name" as window.tC.uniqueEventId.
Back on the tag configuration, expand
(22)"Advanced Settings" and
(23)"Tag Sequencing" to check
(24)the option "Fire a tag before Facebook Pixel fires". In "Set-up Tag", select
(25)"Commanders Act | Serverside events bridge" and save your tag.
Configure the "Tag Sequencing" to fire your Facebook tag(s) after our template tag.
Repeat this configuration for each active "Facebook Pixel" in GTM.