Integrate Facebook Conversions with LeadSquared

1. Feature Overview

This connector uses the Facebook Conversion API to transfer lead data (for leads captured through the Facebook Lead Ads Connector) from your LeadSquared account back to your Meta Business Suite. This connector also syncs custom events that happen during a lead’s journey (such as changes in the lead stage, etc.) with your Meta account. All of this helps optimise targeted ads, decreases the cost per action for each lead, and measures outcomes and performance across Meta technologies.

To know how this connector helps you optimize your Meta campaigns, refer to the Benefits of using the Conversions API to send website events.

Note: This connector syncs lead data for leads that were captured only through the Facebook Lead Ads Connector.

 

2. Prerequisites

  • You must be the Administrator of your LeadSquared account.
  • You must have an active Facebook Ads account.
  • You must install and configure the Facebook Lead Ads Connector. After the connector is installed, you must map the relevant Facebook fields to LeadSquared. Refer to the next section to know more.
  • This is a paid feature. To enable it, reach out to your account manager, or write to support@leadsquared.com.

 

3. Steps to be Completed on the Facebook Lead Ads Connector

Before you install and configure the Facebook Conversions Connector, you must complete the following steps when configuring the Facebook Lead Ads Connector.

  • For this connector to work as intended, you’ll need the Lead Gen ID for all the leads you want to sync with your Meta business account.
  • When configuring the connector, on the Default Mapping screen, map the Lead Gen ID field to a text (string) type lead field, and map the Created Time field to a DateTime lead field. To know how to create a string and DateTime lead field, refer to How to Create Custom Lead Fields.

Facebook Conversions Connector

  • When configuring the connector, on the LeadGen Forms screen, click the Connect LeadGen Forms button to verify if the Lead Gen ID and Created Time are mapped to the correct fields.

LeadSquared Facebook Integration

 

4. How it Works

Before you complete any of the steps listed below, ensure the Facebook Lead Ads Connector is installed and configured in your account. After the connector is installed, you must map the relevant Facebook fields to LeadSquared. Refer to Steps to be Completed on the Facebook Lead Ads Connector.

  1. Install and configure the Facebook Conversions connector
    As part of the connector configuration, a custom activity is automatically created – Facebook Conversion API. This activity is used to send lead data to the Facebook Conversion API.
    Once the connector is enabled, a webhook URL is generated. Copy this URL (you’ll use this while setting up Automation 2).
  2. Create three automations – Create the following automations to identify and push lead data to your Meta account.
    1. Automation 1 – This automation is used to identify the leads captured through the Facebook Lead Ads connector. Use the Lead Create/Lead Update trigger, and add the condition Lead Gen ID contains Data. Then, add an Add Activity card to this automation, and select Facebook Conversion API as the activity. This ensures every time a lead is captured through the Facebook Lead Ads Connector (which is identified by the Lead Gen ID), the Facebook Conversion API activity is posted on the lead.
      To set up the automation, refer to the First Automation.
    2. Automation 2 – This automation is used to transfer lead data to your Meta account. Use the New Activity on Lead trigger, and select the Facebook Conversion API activity. Then, add a webhook card to this automation, and pass the webhook URL that was generated when the connector was configured in your account. This ensures that every time the Facebook Conversion API activity is posted on a lead, the webhook is triggered, which sends the lead data back to your Meta account.
      To set up the automation, refer to the Second Automation.
    3. Automation 3 – This automation is used to identify custom event changes that happen during your lead’s journey in the sales funnel. This automation trigger will depend on the use case you’re trying to solve. We’re using the example of sending data to our Meta account when there’s a Lead Stage change in LeadSquared. We’ll use the Lead Update trigger, with the condition Lead Stage changes from Prospect to Customer. Then, we’ll add an Add Activity card to this automation, and select Facebook Conversion API as the activity. This ensures every time the Lead Stage changes, the activity is posted on the lead, and the lead stage change data is sent to your Meta account (through the webhook configured in your second automation). You can choose to send similar custom event data that’s generated during a lead’s journey in the sales funnel.
      To set up the automation, refer to the Third Automation.

Other example use cases for automation 3 (for the lead behavior data we can send back to Meta) –

  • Opportunity stage change
  • Pricing page visit
  • Payment activity tha’s posted and so on.

 

5. Installation

To install the Facebook Conversions connector –

  1. Navigate to Apps>Apps Marketplace.
  2. Search for Facebook Conversions, and click Install.
    • Alternatively, you can find the connector on the left panel, under Online Ads.
  3. Once installed, hover your cursor over , and click Configure.

Facebook Conversions Connector

 

6. Configure the connector

Once you’ve installed the connector, on the Configure Facebook Conversions pop-up, configure the connector access for the non-Admin users in your account. Only those users for whom access is granted can view and access the connector (under the topbar Apps menu).

  1. Select if you want to grant Connector Access that’s Based on Role or Advanced (User Level).
    • Based on Role – From the Specify Roles dropdown, select the LeadSquared user roles that can use the connector.
    • Advanced (User Level) – From the Advanced (User Level) dropdown, select a user boolean field. Based on the value entered in the selected boolean field, the user can access the connector (e.g., for the user Sam, if the “Is Employee” boolean user field contains the value “Yes”, then this user can access the connector).
  2. Once you’re done, click Save Details. To continue the configuration, refer to the below sections.
Note: By default, all Admin users will have access to the connector.

Facebook Conversions Connector

 

7. Admin Configuration

To continue the connector configuration, navigate to Apps>Facebook Conversions.

Facebook Conversions Connector

7.1 Basic Settings

Enter the following details –

PropertyDescription
Pixel_IDEnter your Meta Business Suite’s Pixel ID.
Access_TokenEnter your Meta Business Suite’s Access Token.
Lead SourceEnter the lead source through which the leads were captured (e.g., Facebook, email campaign, etc.).
Default Country CodeIf the lead’s mobile number is captured without a country code, then the default country code that’s selected from the dropdown will be added to the lead’s mobile number.
Select Time ZoneThe time zone that’s followed in your Meta account.
Lead Capture Search By CriteriaTo avoid transferring duplicate leads, you must select one unique lead field (e.g., email Id, mobile number, etc.) as the search key.

To know how to mark a LeadSquared lead field as unique, please refer to How to Make a Custom Field Unique.

Lead Capture Secondary Search By CriteriaIf lead identification through the primary Search By criteria fails, it will be re-attempted using the secondary Search By criteria.
Select User to Notify on FailureIf there is an error identifying and transferring leads, the selected user will receive a failure message via email. You can select a user from the list of all the users available in your LeadSquared account.

To know more about the type of errors, please refer to Error Notifications.

Enable NotificationEnable the Checkbox checkbox to ensure notification emails are sent to the selected user when there’s a failed query.

Once you’re done entering all the details, click Save & Next.

Facebook Conversions Connector

7.2 Mapping

Once you’ve entered the Basic Settings, click Entity Options. By default, all the Facebook Conversion API fields are mapped to the relevant LeadSquared lead fields.

Note: In this step, you’ll have to click all three Edit Mapping buttons, and on the Edit Mapping pop-ups, even if you don’t make any changes, you’ll have to click Save & Close. This step is mandatory.

i. Lead/Contact Entity – Since this connector is transferring lead details from LeadSquared to your Meta account, the Sync Behaviour should be set to Do Nothing. It is recommended you don’t change this to any other setting.
The lead field mapping is carried out by default. To view/edit the mapping, click Edit Mapping. On the Default Mapping for Lead/Contact pop-up –

      • To edit the Facebook mapping for lead fields name, click  , and under Mapping Key, edit the field name.
      • To change the LeadSquared lead field to which the Facebook field is mapped, click  , and from the Lead Field dropdown, select the new lead field.
      • To mark a unique lead field as the search key, click unique icon.
      • To disable an existing field mapping, alongside the field, disable the slider Zoom.
      • To map an additional field, click the Add Custom button, and add the new mapping field details.
      • Once you’re done editing the mapping, click Save & Close.
        • If you didn’t make any changes, you can skip the instructions above, and directly click Save & Close.

LeadSquared Facebook Integration

ii. Facebook Conversions – This action is set up to trigger the Facebook Conversions API. The API mapping is carried out by default. To view/edit the mapping, click Edit Mapping. On the Edit Mapping for Facebook Conversion pop-up –

    • To edit the default mapping, alongside the field you want to edit, click  .
    • Once you’re done editing the mapping, click Save & Close.
      • If you didn’t make any changes, you can directly click Save & Close.

LeadSquared Facebook Integration

iii. Activity Entity – In this step, we add a dummy activity (any activity will do) and click the Save & Close button (we’re adding the Meta Activity as an example in this step).
While the configurations on this step will not impact the connector behavior (since we’ll disable the slider), it is still mandatory to complete the actions listed to proceed.
Set the Sync Behaviour to Capture, and click Edit Mapping. On the Default Mapping for Activity pop-up –

    1. Click the Add Custom button, and under the fields listed below, enter the following details –
      • System Field – Meta Activity.
      • Activity Type – Chat conversation.
      • Activity Fields – Note.
      • RequiredDisable the Required field. The slider should look like this Slider once disabled.
      • Under Actions, click Google.
    2. Then, click Save & Close.

Facebook Conversions Connector

iv. Activity Type(s) Definitions – This creates the custom activity type based on which you’ll set up an automation to transfer lead data to your Meta account. Click Create Activity. The custom activity called Facebook Conversion API is created.
v. Once all the steps listed above are completed, click Save & Next.

Facebook Conversions Connector

7.3 Webhook URL

After you provide basic details and finish field mapping, a custom webhook URL is generated. Copy this webhook URL, and use it to create an automation that will push the lead conversion data to your Meta account.

Facebook Conversions Connector

 

8. Create Automations

Set up three automations –

  • The first automation is used to identify the leads captured through the Facebook Lead Ads Connector.
  • The second automation is used to send lead data to your Meta account.
  • The third automation is used to identify custom event data (like Lead Stage change, etc.) that occurs during a lead’s journey.

8.1 First Automation

This automation is used to identify leads captured through the Facebook Lead Ads Connector, based on  Lead Gen ID. Once the leads are identified, set the automation to post the Facebook Conversion API activity on these leads.

  1. Navigate to Workflow>Automation, and click Create Automation, and select the trigger as Lead Create/Lead Update.
  2. On the Automation starts when a Lead is created pop-up –
    1. Click Add Condition.
    2.  On the Select Criteria pop-up, set Lead Gen ID Contains Data, and click Add Condition.
  3. Once you’re done, click Set Criteria, and click Save.

Facebook Conversions Connector

iv. Then, click Add Automation, and under Lead Actions, click Add Activity. From the Activity Type dropdown, select Facebook Conversion API. On the Add Activity pop-up, click Add an additional field to add the following fields –

    • Event Name – It is mandatory to pass the event name as “Raw Fb Lead Event”.
    • Lead ID – Mail merge the Lead Gen ID @{Lead:mx_Lead_Gen_ID,} to identify the leads captured through the Facebook Lead Ads Connector.
    • Custom Data – In this field, pass the following –
      {“event_source”: “crm”,
      “lead_event_source”: “LeadSquared”}
    • Note – In this field, pass the following –
      {“event_source”: “crm”,
      “lead_event_source”: “LeadSquared”}
    • Email Mail merge – Mail merge this to the email lead field. We’ve gone with @{Lead:EmailAddress,}. If the lead’s email is stored in a different lead field in your account, mail merge that field here.
    • Time Stamp – You can mail merge this to any date field available in your account.

v. Once you’re done, click Save, and then click Publish.

Facebook Conversions Connector

8.2 Second Automation

This automation is used to ensure every time the Facebook Conversion API activity is posted on the lead, the webhook URL (which was generated when the connector was configured) transfers lead data to your Meta account.

  1. Navigate to Workflow>Automation, click Create Automation, select New Activity on Lead as the trigger.
  2. From the Select an activity dropdown, choose Facebook Conversion API and click Save.
  3. Click Add Automation, and under Custom, click Webhook.
  4. On the Webhook pop-up, enter the following details –
    • Name – Enter a relevant name for the webhook. We’re calling it “Facebook Conversion”.
    • URL – Select the method as https://, and paste the connector’s webhook URL that was generated. Before you paste the URL, ensure you remove “https://” from the URL.
    • Content Type – Select application/json.
    • Save Response – You can select either Yes or No.
    • Custom Headers – You can skip this step.
    • Notify on Failure – Select which user you want to notify if the webhook fails.
    • Retry Count – The number of times you want to retry when the webhook fails.
  5. Once you’re done, click Save, and then click Publish.

Every time the automation is triggered, this webhook will push lead data to your Meta account.

Note: To know more about the Webhook action, refer to User Automation Actions – Webhook.

Facebook Conversions Connector

8.3 Third Automation

This automation is used to identify custom events that occur during your lead’s journey in the sales funnel. Examples of custom events are Lead Stage change, Payment activity posted, etc. You can set up the automation trigger to identify the event for which you want to send data. We’re setting up the automation to trigger when the Lead Stage changes from Prospect to Customer. This lead conversion (change) data for the selected lead is transferred to your Meta account.

Note: If the third automation is lead-dependent, the event trigger should include the additional condition Lead Gen ID Contains Data. This is to ensure the automation triggers only for leads captured through the Facebook Lead Ads connector (and NOT from any other lead source).

  • Navigate to Workflow>Automation, and click Create Automation, and select a relevant trigger.
    1. We’ve selected Lead Update.
  • On the Automation starts when a Lead is Updated pop-up –
    1. From the Lead Field dropdown, select Lead Stage.
    2.  We’re setting the stages as Prospect (From) to Customer (To).
  • Once you’re done, click Save.
Note: Select any trigger/condition here depending on your use case and the lead journey/event data you want to send to your Meta account.

Facebook Conversions Connector

iv. Then, click Add Automation, and under Lead Actions, click Add Activity. From the Activity Type dropdown, select Facebook Conversion API. On the Add Activity pop-up, click Add an additional field to add the following fields –

    • Event Name – It is mandatory to pass the event name as “Second Event – Custom Sales Event”.
    • Lead ID – Mail merge the Lead Gen ID @{Lead:mx_Lead_Gen_ID,} to identify the leads captured through the Facebook Lead Ads Connector.
    • Custom Data – In this field, pass the following –
      {“event_source”: “crm”,
      “lead_event_source”: “LeadSquared”,
      “Lead_stage”: “Customer” }
      The “event_source” must remain as “crm”, but the other key-value pairs can change depending on the use case you’re trying to solve.
    • Note – In this field, pass the following –
      {“event_source”: “crm”,
      “lead_event_source”: “LeadSquared”,
      “Lead_stage”: “Customer” }
      The “event_source: must remain as “crm”, but the other key-value pairs can change depending on the use case you’re trying to solve.
    • Email Mail merge – Mail merge this to the email lead field. We’ve gone with @{Lead:EmailAddress,}. If the lead’s email is stored in a different lead field in your account, mail merge that field here.
    • Time Stamp – You can mail merge this to any date field available in your account.

v. Once you’re done, click Save, and then click Publish.

Facebook Conversions Connector

 

9. View Logs

Here, you can view logs of all the sync jobs that have taken place. View New Events (New Leads), Updated Events (Updated Leads), and Errors (when capturing leads).

  1. Navigate to Apps>Swipe Pages.
  2. From the More Actions dropdown, click View Logs.
  3. You can filter the logs by selecting a date range (Today, Last 7 Days, This Month, and Last Month), by selecting the Job Status (“All”, “Success” and “Failure”), and by selecting the Sync Status (All, Error, and Success).
  4. You can view the sync status of the following events –
    • New Events – List of all the new leads that have been created in LeadSquared during the selected date range.
    • Updated Events – A list of all the –
      • Duplicate leads that were created with the same Search by Criteria value (e.g., with the same Email Id, Mobile Number, etc.).
      • Leads that previously contained errors, which were fixed and synced successfully.
    • Failed – The list of leads that have not been captured due to mapping errors (e.g., when a boolean field is mapped to an integer field, etc.).
  5. To view the Sync Response details, under Request ID/Sync Job ID, click the Id.
    • Under the right panel, you can view the response status, the API URL, the request, and the response.
    • The responses that are successful will contain the details of the leads that have been pushed from Swipe Pages.
    • To view the lead capture response under Sync API Response, Leads Updated and Errors in Leads, click Information.

Note:

  • For a response that contains an error, the reason for the error is listed in the response. Once you fix it, you can click the Retry button to perform the sync again.
  • The current Lead Sync Behaviour will reflect in the Logs screen. This will help identify the sync that’s used (Capture or Update) for the selected Request/Sync Job Id.

google forms view logs

 

10. Other Actions

You can edit or delete the Swipe Pages connector instance that you created. To do this –

  1. Navigate to Apps>App Marketplace.
  2. Search for Facebook Conversions Connector.
  3. Alongside the connector, hover your cursor over .
  4. From the list of options, you can perform the following actions –
    • Edit Configuration
    • Disable Configuration
    • Remove Configuration

Facebook Conversions Connector

 

Any Questions?

Did you find this article helpful? Please let us know any feedback you may have in the comments section below. We’d love to hear from you and help you out!

Was this Helpful?

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments