
You can enrich events collected in Facebook Pixel with any event gathered in Synerise. Based on Facebook Conversion API, Synerise enables sending all event parameters or only its chosen parameters. In this use case, we will send offline transactions to Facebook  using the dedicated integration node in Automation Hub.

## Prerequisites
---
- [Create a Pixel in Facebook](https://developers.facebook.com/docs/facebook-pixel).
- [Generate an access token in Facebook](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token).
- [Implement offline transactions events](https://developers.synerise.com/ClientManagement/ClientManagement.html#operation/CreateATransaction).

## Create a workflow
---
In order to send offline transactions using Automation Hub, create a workflow that is triggered by a purchase in the point of sales. Through the Facebook Integration node, Synerise sends this event to Facebook.

### Add the Profile Event trigger

1. In the Synerise app, go to **Automation Hub > Workflows > New workflow**.
2. On the dashboard, click the plus button.
3. From the dropdown list, select **Profile Event**.
4. Double-click the **Profile Event** node.
5. On the pop-up, from the **Choose event** list, select the transaction event. If you're not sure of the event's label in your system, search for `transaction.charge`.
6. Click the **+ where** button.
7. From the **Choose parameter** dropdown list, select **$source**.
8. From the **Choose operator** dropdown list, select **Equal**.
9. In the text field, enter `POS`. 
10. Confirm by clicking **Apply**.  

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/offline-transaction-trigger.png" alt="Configuration of the Profile Event trigger" class="full">
<figcaption> Configuration of the Profile Event trigger </figcaption>
</figure>

### Configure Facebook Integration node

1. On the **Profile Event** node, click the plus icon.
2. From the dropdown list, select **Facebook**. 
3. From the dropdown list, select **Send Offline Transactions**. 
4. Click the node. 
5. Click **Select connection**.  
6. From the dropdown list, select the connection.  
   If you haven't established a connection yet, see [Create a connection](/use-cases/sending-offline-transactions-facebook#create-a-connection).

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/off-trans-node.png" alt="Configuration of the Facebook Integration node" class="medium">
<figcaption> Configuration of the Facebook Integration node </figcaption>
</figure>

### Create a connection
Use an access token which allows you to send a request.  

1. At the bottom of the **Select connection** dropdown list, click **Add connection**.  
2. In the **Access token** field, enter the app access token.  
    
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   You can read more about access tokens in [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token).

   </div></div></div>
  
3. Click **Next**.  
4. In the **Connection name** field, enter the name for the access token you generated. 
5. Click **Apply**.  
        **Result**: A connection is created and selected. 

### Define the integration settings

1. In the **Graph API version** field, enter the currently used API version in Facebook.  
    You can find information about the currently used API version in the Facebook documentation.  
2. In the **Meta Pixel ID** field, enter the identifier of the Pixel you use in Facebook.  
    You can find information about how to find ID of the Pixel in the Facebook documentation.
3. From the **Identifier type** dropdown list, select the identifier of customer - an email address of phone number.  
    Offline transactions will be matched with customers based on this identifier.  
4. In the **Identifier source** field, enter the Automation insert (Jinjava tag) that corresponds to the identifier you selected as the **Identifier type**.  
    
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Read the article about the [Automation inserts](/developers/inserts/automation).

   </div></div></div>

5. In the **Currency code** field, enter the ISO currency code of the transactions, for example, `USD`, `EUR`, `GPB`, `AUD`, `PLN`, and so on.
6. Confirm by clicking **Apply**.  

### Add the End node
12. On the **Outgoing webhook** node, click the plus button.
13. From the dropdown list, select **End**.
14. Save and activate the automation by clicking **Save&Run**.

    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/off-trans-workflow.png" alt="The final structure of the workflow" class="full">
    <figcaption> The final structure of the workflow </figcaption>
    </figure>
15. Go to your Facebook Ad account, select **Facebook Manager > Events Manager** to see the events. After the offline transaction, the `automation` event is visible on the customer's card with 200 status. That means that the transaction has successfully been sent to Facebook. 

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/success-offline-transaction.png" alt="A webhook response with 200 status on a profile of a test customer" class="large">
<figcaption> A webhook response with the OK status (200) on a customer's profile </figcaption>
</figure>


## Check the use case set up on the Synerise Demo workspace
---
You can also check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/5a304073-4d44-448a-a4b3-812054f4a423) directly in Synerise Demo workspace.

If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace.  

If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.

## Read more
---
- [Automation Hub](/docs/automation)
- [Facebook integration](/docs/automation/integration/facebook)