Conversions API (Facebook/Meta CAPI) Quick-Start Guide

Start sending Confection data to the Facebook/Meta Conversions API (CAPI) with a few simple steps.

Issues? Questions? Feedback? Leave a comment. Already have a Confection account? Already installed Confection on your site or app? Skip to step four. New to Confection? Learn more here.

Get Started

Step One

If you haven’t already, create a Confection account. If you already have a Confection account, log in.

Continue to Step 2

Step Two

Click “My Account” (or “Set Up My Account” if you’re accessing your account for the first time). Enter your contact information, the domain(s) on which you want to use Confection, and select one of our two data storage options. Then, click “Save Changes.”

Continue to Step 3

Step Three

Click "Install Confection" (If you're accessing your account for the first time, this will be the default screen.) Select your preferred langauge, CMS, platform, or framework to download the relevant scripts.

At this point, use the relevant language, framework, CMS, or platform quick start guide to get Confection up and running on your site or app. Then, continue with step four.

Continue to Step 4

Step Four

Help customers gain data independence by giving them control over their atomic-level digital marketing data – this is Confection’s mission. By generating their own pageview data, acquisition intel, and session intelligence, Confection customers operate independently of other tools and systems. These routinely fail because of browser and device disruptions involving cookies, cross-domain scripts, and device IDs.

As one of our customers recently asked, "Why would I use app scripts, pixels, or tags to generate my digital marketing data? I can't necessarily trust or audit them. Why wouldn't I just write my data to my own systems myself?"

Thanks to Confection, our customers can do exactly that: write high-fidelity data to CRMs, analytics tools, ad campaigns, and other meaningful endpoints. They're no longer dependent on scripts, pixels, or tags to generate their digital marketing data.

While our account API and lowcode/nocode connectors at Zapier, Pipedream, Make (Integromat), and Tray.io allow customers to write data just about anywhere, the majority of our customers do two things with Confection:

  • They write better data to analytics tools like Google Analytics and Matomo.
  • They send better data to Facebook ads and audiences.

In effect, Confection enables customers to operate as their own analytics script and ad pixel. We have native integrations for UA, GA4, and Matomo. This guide focuses on the ways customers can use Confection and the Conversions API (CAPI) to amplify the performance and quality of their Facebook/Meta ads and audiences.

By ingesting high-quality, browser-based session intelligence and sending it to the CAPI, Confection customers can improve the precision of Meta reporting dashboards, enhance the learning experience of the Meta algorithm, and, ultimately, boost ROAS by improving ad performance, retargeting outcomes, and custom audience quality.

About Confection Events

Confection automatically tracks the following kinds of events:

  • form fields (which we treat as PII)
  • page load speed
  • pageviews and associated session intel (eg., acquisition data)

With a few lines of code, customers can also track eCommerce purchase events and send them directly to GA and Matomo. See this documentation for more information.

As we outline in our dashboard documentation, Confection also supports generic custom events. To submit a custom Confection event, use this syntax:

Add that above your site’s </head> tag and below your Confection header code. For example, if you wanted to submit a custom event named click with a value of 1, you’d add this to your site:

<script>
confection.submitEvent("click", 1);
</script>


Preparing Confection Events for the CAPI

As Meta documents here, events you submit to the CAPI must have a unique name. To ensure event data isn't duplicated or cross-pollinated, each event should also have a unique ID. With unique IDs in place, the CAPI can distinguish between similar – but distinct – events like purchases, downloads, and button clicks. Order numbers can serve as event IDs, but so can random alphanumeric strings (eg., 123abc).

Customers can easily modify generic Confection custom events so they contain unique IDs. For example, to modify the previous custom event example so it has a unique ID for the CAPI, we'd structure it as follows:

<script>
confection.submitEvent("click", "alphanumericIDhere");
</script>

In this case, click would be the CAPI event name, and alphanumericIDhere would be the unique ID.

Sending eCommerce purchase events to the CAPI is even easier. These events already contain unique IDs that correspond with your system's order ID. You can see this in line three below:

If, for some reason, you want or need to use a different or additional event ID for the CAPI, you can send an additional event after the main purchasedEvent. See line 27 below as an example where purchasedCAPI is the event name and alphanumericIDhere is the event ID.

Confection custom event values support JSON-encoded strings. This would allow you to send even more kinds of information to the CAPI. For convenience’s sake, here’s a template with common CAPI parameters that you can use to prepare your event submission. Find the complete list here.

Writing Data to the CAPI

Once you've prepared your events for the CAPI, you can send data into Meta from your Confection account API or your BigQuery dataset. (If you need to connect your Confection account to BigQuery, see our quick-start guide here.)

Just connnect to the CAPI via POST requests and/or Confection's lowcode/nocode connectors at Zapier, Pipedream, Make (Integromat), and Tray.io.


“I have some questions.”

Next Steps

Install & Integrate Elsewhere

Find Other Quick-Start Guides

"I have some questions."

Contact Us

"I want to see this."

Share It

Discussion

Questions or comments about using Confection with Conversions API (Facebook/Meta CAPI)? Leave them below.

"Please contact me. I have some questions."

You can also use the chat app in the lower right corner.