Moving to Facebook’s Conversion API from a Traditional Pixel Setup

If you’re advertising to customers using Facebook, setting up server-side conversion tracking using Facebook’s Conversion API is now the best way to measure results.


If you are currently using the traditional Facebook Meta pixel and looking to take advantage of the Facebook Conversions API, the following may help.

Platform Context

The environment in this example is a WordPress website using Google Tag Manager. Google Tag Manager is a central location to dynamically add JavaScripts and event firing/triggers across your website, without having to physically put this code in your website and re-deploy each time. Even if you are technically inclined with development skills, Google Tag Manager is a simple and effective way to manage the many JavaScript additions that build up as your site starts to integrate with multiple third parties, for purposes of data insights, tracking and measurement that supports better business decisions. It provides version control, testing capabilities, roll-back capabilities as well.

In this example, Facebook’s traditional client side tracking “Pixel” (code snippet) is placed into Google Tag Manager, which simply the applies the Facebook script snippet onto the website. In addition, for this example, custom event triggers have been added to Facebook’s Pixel functionality, also using Google Tag Manager. Find out more about tracking custom events other than just page views or standard form submissions here.

Why Move to Facebook’s Conversion API, from the Facebook Pixel (now Meta Pixel)

Technical Limitations of Facebook Pixel

  1. Browser Restrictions: Modern browsers block third-party cookies, which Pixel relies on, leading to lost tracking events.
  2. Ad Blockers: Many users employ ad blockers that disable JavaScript tracking like the Pixel, reducing data accuracy.
  3. Cross-Device Limitations: Pixel struggles with tracking users across different devices unless they are logged into Facebook on each device.
  4. Data Loss: Automatic browser privacy settings and user preferences can prevent Pixel from capturing complete interaction data.

Also, Apple’s Privacy Changes:

  1. App Tracking Transparency (ATT): Requires apps to get user permission to track activities across other companies’ apps and websites. This dramatically reduces the effectiveness of the Pixel on iOS devices.
  2. Intelligent Tracking Prevention (ITP) in Safari: Aggressively blocks third-party cookies and limits first-party cookies, disrupting Pixel’s ability to track user behaviour across sites.

GDPR’s Impact:

  1. Consent Requirement: Under GDPR, users must consent to cookies and tracking, making the Pixel’s automatic tracking without explicit consent non-compliant.
  2. Data Minimization and Purpose Limitation: The principles of GDPR require that only necessary data be collected and for explicit purposes, challenging the broader data collection practices of the Pixel.

Advantages of Using Conversions API:

  1. Server-Side Tracking: Bypasses browser-based limitations, capturing events directly from the server for more reliable data.
  2. Enhanced Privacy Compliance: Allows for controlled data sharing, aligning with GDPR and other privacy regulations by minimizing client-side exposure.
  3. Improved Data Completeness: Reduces data loss from ad blockers and browser restrictions, ensuring more comprehensive capture of user events.
  4. Cross-Device Compatibility: Better at tracking user interactions across devices by linking server-side data with user actions.

These changes underscore the need for more privacy-centric approaches like the Conversions API, ensuring compliance and maintaining tracking effectiveness.

A Recap of the Existing Meta Pixel Setup in this environment

Recap of Existing Client Side Pixel Setup – with Custom Events

Custom Events Setup in Facebook Events Manager so that more specific Information about particular Events:

  • PageView
  • Lead
  • ClickGiveMeACall
  • ClickBookAnApptment
  • SubmitBookAnApptment

Then in Google Tag Manager
in addition to the Facebook pixel script, I have setup 5 additional events to track

Facebook Pixel - Event - Track Lead
<script>
fbq('track', 'Lead');
</script>

Triggered by … the visibility of various form elements across the website, any form submission that is considered to be a “Conversion”

Facebook Pixel - Event - Click ClickGiveMeACall
<script>
fbq('track', 'ClickGiveMeACall');
</script>

Triggered by … click of a specific element CSS class.

and similar for ..
Facebook Pixel – Event – ClickBookAnApptment
Facebook Pixel – Event – SubmitBookAnApptment

Let’s Get This All Happening with Facebook Conversions API

Note: If you’re an AWS user, beware that Facebook, in its AdsManager UI may offer to setup servers on AWS on your behalf, using your login. Recommendation is not to do this, can result in a lot of resources being added to your AWS Account at great cost. Personally had this experience while testing, and within 2 months, AWS account accrued over $1000 of service charges as a result of Facebook adding services.

Install and Configure Facebook a WordPress Plugin?

OPTION TESTED: Meta pixel for WordPress plugin: reviews and testing reveals this to be buggy and with potential security flaws.

OPTION TESTED: WooCommerce Facebook Plugin – when running an eCommerce store there can be ways to use this plugin to track common shop events, like adding to cart and purchases. (But is this in addition to other events without a store?)

OPTION TESTED: PixelYourSite – Seems to cover everything, but a little too over the top.

Google Tag Manager Server Side Events?

Google tag manager provides ways of handing this (yep, server-side events), though as of time of writing, we haven’t had a chance to setup and test it yet and continued to test WordPress plugins.

Develop Custom Code to Manage It?

We experimented with developing custom code to do this. But deferred doing this as a result of finding some good

Define Plugin Structure:

  • Create a main PHP file for the plugin and necessary subdirectories for assets, includes, and languages if needed.

Handle Dependencies:

  • Ensure your plugin checks for dependencies like the existence of Google Tag Manager and other necessary components.

Admin Interface:

  • Build a simple admin interface in the WordPress dashboard where users can input settings such as their GTM server-side endpoint, Facebook Pixel ID, and Conversions API token.

Event Listener:

  • Use WordPress hooks and filters to listen for key actions (e.g., form submissions, page views).
  • Map these actions to data layers or direct event calls to GTM.

Data Layer Integration:

  • Modify the site’s front end to push events to the data layer, ensuring they align with what your server-side GTM expects.

Server-Side GTM Configuration:

  • Provide documentation or an importable GTM container setup to help users configure their server-side GTM to handle events from WordPress and send them to the Facebook Conversions API.

Found WordPress Plugin to Test, Seems to Be Best

Give this Plugin at try in order to solve this. Seems to be the best from those we tested.

For managing both WooCommerce events and standard events, as well as your own custom events. Don’t forget to remove the snippets from Google Tag Manager if you had been previously managing your pixels and triggers from there.

0 0 votes
Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

0
Would love your thoughts, please comment.x
()
x