This is a Jitsu.Classic documentation. For the lastest version, please visit docs.jitsu.com. Read about differences here.
Facebook Conversion API
Jitsu supports Facebook Conversions API as a destination. All event fields after Mapping Step will be formatted as JSON body and will be sent via Facebook Conversion API with HTTP POST request.
Facebook destination supports only stream mode and 
should have mapping rules compatible with
FB API parameters. See mapping below
Filtering events#
For filtering events stream to prevent sending all events to Facebook table_name_template is used.
For more information see Table Names and Filters.
Configuration#
Facebook destination config consists of the following schema:
destinations:
  my_facebook:
    type: facebook
    mode: stream
    facebook:
      pixel_id: <YOUR_PIXEL_ID> #see below how to get it from Facebook
      access_token: <YOUR_ACCESS_TOKEN> #see below how to get it from Facebook
    data_layout:
      table_name_template: "$.event_type" #Optional. It is used for filtering events.
      mappings:
        keep_unmapped: false
        fields:
          - src: /_timestamp
            dst: /_timestamp
            action: move
          - src: /event_type
            dst: /event_name
            action: move
          - src: /eventn_ctx/event_id
            dst: /event_id
            action: move
          - src: /event_id
            dst: /event_id
            action: move
          - src: /eventn_ctx/url
            dst: /event_source_url
            action: move
          - src: /url
            dst: /event_source_url
            action: move
          - src: /source_ip
            dst: /user_data/client_ip_address
            action: move
          - src: /eventn_ctx/user/email
            dst: /user_data/em
            action: move
          - src: /user/email
            dst: /user_data/em
            action: move
          - src: /eventn_ctx/user_agent
            dst: /user_data/client_user_agent
            action: move
          - src: /user_agent
            dst: /user_data/client_user_agent
            action: moveFacebook credentials (facebook field below)#
| Field | Type | Description | 
|---|---|---|
| pixel_id (required) | string | Facebook Pixel ID, from the data source created on the Facebook page . | 
| access_token (required) | string | Facebook access token, from the data source. Read more about access token creation . |