How to set up Facebook Conversion API with GTM Server Side

Server side event tracking and the Conversion API have been available on Facebook for several years. But, starting in 2021, FB has become more active in promoting this. If you have a Facebook manager helping with your account, they will most likely call you and recommend setting up the Conversion API .





Therefore, if you have already been contacted or you yourself have decided that you need to configure the CAPI (Conversion API), please, under cat. There I describe one of the recommended configuration methods, namely through the Google Tag Manager Server Side .





FB CAPITag
FB CAPITag

To set up the Facebook Conversion API using the Google Tag Manager container server, you must first set up Universal Analytics or GA4 via GTM SS. All events that you want to track on Facebook must be configured in UA / GA4, since all information for sending a request to FB CAPI will be generated based on events sent to Google Analytics.





In this article, I will not talk about how to create and configure a GTM web container or event tracking using the FB web pixel, since it is assumed that you are already well acquainted with the GTM container setup. 





GTM SS   . . FB CAPI.





GTM SS , GTM SS .





UA GA4 FB CAPI . FB GA4 , UA custom dimensions. GA4 .





.





1) , UA GA4 GTM Web GTM SS. transport_url GTM SS .





GA4:





GA4 tag
GA4 tag

UA:





UA tag
UA tag

2) GA GTM. GA4 GA4 a UA Universal Analytics. . “Custom”, «Some events». Universal Analytics GA4 .





:





UA Server Side Tag
UA Server Side Tag

:





UA Trigger
UA Trigger

3) Facebook GitHub . Templates -> Tag Templates -> New. . Github FB UA GA4 .





Server Side Tag Import
Server Side Tag Import

:





Server Side Template
Server Side Template

4) Facebook Conversion API GTM SS . Tag -> New -> Facebook, . Facebook Facebook API ( , Facebook ). Facebook API, . Facebook Conversion API: new trigger -> custom trigger -> event name equals page_view.





:





5) .





FB CAPI.





FB Web Pixel . FB web pixel FB CAPI .





FB Conversion API, . . .





GTM Unique Event ID ID . FB Web Pixel event_id UA custom dimension GA4 FB CAPI event_id.





Configuring FB CAPI requires patience) So I wish you all the best in this difficult task, and I hope this post will help you with that.








All Articles