# How it works: Shopify to Meta Conversions API (CAPI)

## What you can track

Here's what you can track with Littledata's Meta connection for Shopify.

All the events below are tracked by default. You can turn events off in the settings.

### Client-side events

| **Event name**      | **Description**                                                            |
| ------------------- | -------------------------------------------------------------------------- |
| ViewContent         | A visit to a web page such as a product page or landing page               |
| InitiateCheckout \* | The start of a checkout process. For example, clicking the Checkout button |
| AddPaymentInfo \*   | The addition of customer payment information during a checkout process     |
| Purchase \*         | Completing the checkout and viewing thank you page                         |

\* Only for stores with the [Littledata Pixel](https://help.littledata.io/shopify/littledata-pixel) connected

### Server-side events

| **Event name**       | **Description**                                                                                                                           |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| AddToCart            | The addition of an item to a shopping cart or basket. For example, clicking an Add to Cart button.                                        |
| InitiateCheckout     | The start of a checkout process. For example, clicking the Checkout button.                                                               |
| AddPaymentInfo       | The addition of customer payment information during a checkout process. For example, a customer clicks to save their billing information. |
| Purchase             | Completing the checkout and receiving an order confirmation                                                                               |
| Post Purchase Upsell | The completion of an upsell purchase, that will contain only the newly added products.                                                    |
| Recurring Purchase   | The completion of an automatic recurring purchase, such as a recurring order from Recharge subscriptions.                                 |

Note: **Remove from cart**, **view item list** and **refund** events are not officially supported by Meta Conversions API. This is a limitation on Meta's side, not Littledata's.

{% embed url="<https://www.youtube.com/watch?v=mOKQF3LnN00>" %}

### Lifetime value

For each Purchase and Recurring Purchase event, Littledata sends a parameter named **`predicted_ltv`**. This parameter contains the lifetime value of the user. We pull this information directly from Shopify and then make sure that it syncs correctly with Meta.

## New customer vs returning customer conversions

We automatically track four types of Meta conversions. Here's a breakdown of each and how they work:

| **Conversion Name**                      | **What it tracks**                                                                                    |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Purchase                                 | Every order from any customer is counted, except recurring orders.                                    |
| New Customer Purchase - Littledata       | Counts only the first time a customer purchases on Shopify                                            |
| Returning Customer Purchase - Littledata | Counts every purchase of a customer, except the first one. This event also includes recurring orders. |
| First Recurring Purchase - Littledata    | Only the first recurring purchase of a subscription customer                                          |

{% hint style="info" %}
The default **Purchase** conversion will count any purchase event and should be the sum\* of **New Customer Purchase - Littledata** and **Returning Customer Purchase - Littledata** events.\
\
\*Returning Customer Purchase - Littledata will include **recurring orders** as well, so total Purchase numbers might differ if your store runs subscriptions.
{% endhint %}

## How Littledata improves the event match quality score

Littledata is sending all the parameters needed by Meta to perfectly match the events. Our **Conversions API integration** follows Meta's hashing requirements, ensuring that all parameters are received and processed to increase the event match quality.

The most important parameters are the user parameters. If an event does not have at least one user parameter, Meta will not accept said event.

{% hint style="info" %}
[Here ](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters)are all the customer parameters that Meta uses.
{% endhint %}

Littledata sends all the parameters with the exception of:

* `external_id` (any unique ID from the advertiser)
* `fb_login_id` (the ID issued by Meta when a person first logs into an instance of an app)
* `lead_id` (the ID associated with a lead generated by Meta's Lead Ads)
* `ge` (gender parameter)
* `db` (date of birth)

### Action\_source parameter

The `action_source` parameter is an indicator of where the conversion was made. Knowing this is a great way to ensure your ads are targeted in the right direction.

Littledata can send this parameter with only 3 values:

| **Value**         | **Source**       |
| ----------------- | ---------------- |
| website           | Online Store     |
| system\_generated | Subscription App |
| physical\_store   | POS Order        |

### Fbp and fbc parameters

The most important parameters that we send are **`fbp`** and **`fbc`** cookies, which are the equivalent of the Google client ID. These parameters are vital in the event match quality score. That is why we implemented a way to always have an **`fbp`** available.

In the event that the **`fbp`** parameter cannot be retrieved (due to ad blockers), we will automatically generate an **`fbp`** and attribute it to the user so that the event match quality will not be impacted.

The **`fbp`** and **`fbc`** parameters are passed with server-side events as well to ensure the highest event match quality.

### User agent and IP address

These parameters are also essential for the event match quality score. They work similar to **`fbp`** and **`fbc`** cookies but are easier to retrieve from the browser.

User agent and IP address are automatically added to the browser events, but we pass them to the server-side events as well so the event match quality can increase.

Besides `fbp`, `fbc`, user agent and IP address, there are other parameters that we send:

* **`em`** - email of the user (hashed)
* **`ph`** - phone number of the user (hashed)
* **`fn`** - first name (hashed)
* **`ln`** - last name (hashed)
* **`ct`** - City (hashed)
* **`st`** - State (hashed)
* **`zp`** - zip code (hashed)
* **`country`** - Country of the user (hashed)
* **`subscription_id`** - sent with a recurring order

All of these parameters are passed from the browser to the server so that the right user is attributed to the event.

For a more detailed schema and parameters, reach out to <help@littledata.io>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/integrations/facebook-capi/how-it-works-shopify-to-meta-conversions-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
