9  min read

How to set up and track Facebook & LinkedIn Ads Conversions using Integrately

Abhishek Agrawal
By Abhishek A Agrawal
July 22, 2024
Table of Contents

    Introduction

    Running targeted ads on Facebook & LinkedIn is a powerful way to reach business professionals.

    But do you track what happens after someone clicks your ad?

    Do they visit your website? Check your features page? Sign up? Submit a form? Register for an event?

    You can easily track these conversion actions using Integrately.

    But, let’s first understand how tracking conversions benefits your business.

    Why do you need to track Facebook & LinkedIn Ad conversions?

    By tracking Facebook & LinkedIn Ad conversions, you can

    • See which parts of your Facebook and LinkedIn ad funnels are working and which ones need improvement
    • Focus your budget on ads that are driving real results and adjust your targeting or messaging accordingly
    • Show the right ads to the right audiences
    • Optimize your campaigns for better lead generation and ROI
    • Save time in tracking data or compiling reports manually from multiple platforms

    Moreover, using Integrately to track website conversions helps you tackle issues like Adblockers & third-party cookies.

    Which Ad conversion events can you track through Integrately?

    Integrately helps you send conversions that happen post ad clicks directly to Facebook or LinkedIn.

    You can send conversions to Facebook and LinkedIn from anywhere, including:

    • Your website
    • Other apps from your funnel like
      • Forms
      • Surveys
      • CRM
      • eCommerce stores
      • Payment processing platforms
      • Accounting platforms, & more

    These conversion events include (but are not limited to):

    • Web page views & clicks
    • Signups
    • Form submissions
    • Event registrations
    • Purchases / Subscriptions
    • Downloads, & any other key conversions

    Tracking these valuable conversions gives you a clear picture of what’s driving results for your business on Facebook / LinkedIn.

    2 easy ways to add code for tracking website conversions

    Note: A little bit of developer help is required to send website conversions to Facebook / LinkedIn.

    To start sending conversions to Facebook / LinkedIn, you need to include a small piece of JavaScript code in Google Tag Manager or directly on your website.

    This can be done in 2 ways :

    1. Include via jsDelivr
    2. Inject via Google Tag Manager
    Include via jsDelivr
    Inject via Google Tag Manager

    Include via jsDelivr

    To include this library in your project via jsDelivr, add the following script tag to your HTML file:

    <script src="[https://cdn.jsdelivr.net/gh/CompanyHub-IG/Integrately-Public-Analytics-via-Webhook@latest/integratelyWebhookLibrary.js](https://cdn.jsdelivr.net/gh/CompanyHub-IG/Integrately-Public-Analytics-via-Webhook@latest/integratelyWebhookLibrary.js)"></script> 

    To send an event with data using this library, you can follow this syntax:

    ig.init("some_webhook_id_or_url");  
    ig.sendEvent("onclick", { key: "value" }, false);

    Inject via Google Tag Manager

    You can inject this library into your website using Google Tag Manager. Follow these steps:

    • Log in to your Google Tag Manager account.
    • Create a new Tag.
    • Choose “Custom HTML” as the tag type.
    • Paste the provided code snippet into the HTML field.
      <script>  
          (function () {  
          var script = document.createElement('script');  
          script.type = 'text/javascript';  
          script.src = '[https://cdn.jsdelivr.net/gh/CompanyHub-IG/Integrately-Public-Analytics-via-Webhook@latest/integratelyWebhookLibrary.js](https://cdn.jsdelivr.net/gh/CompanyHub-IG/Integrately-Public-Analytics-via-Webhook@latest/integratelyWebhookLibrary.js)';  
          script.onload = function () {  
          console.log("Script loaded successfully");  
          initializeScript(); // Call the function after the script is loaded  
          };  
          document.head.appendChild(script);  
          })();  
          
          // Function to initialize your script once it's loaded  
          function initializeScript() {  
          ig.init("some_webhook_id_or_url");  
          ig.sendEvent("eventName", { someKey: "someValue" }, true);  
          }
      </script>
      
    • Set the trigger to fire on all or specific pages where you want to use this library.
    • Save the tag and publish your changes.

    The above GTM code will send static data as defined in the code. If you want to send event data dynamically, you can also implement the following code on your website.

    When the script is loaded via Google Tag Manager (GTM), it will invoke the initializeScript() function. Within initializeScript(), you can call ig.sendEvent() to trigger the webhook on Integrately.

    Example as below,
    JavaScript Code :-

    <script>  
        function initializeScript() {  
        ig.init("some_webhook_id_or_url");  
        ig.sendEvent("eventName", {  
        someKey: "someValue"  
        }, false);  
        }  
    </script>
    

    Send website conversions to Facebook / LinkedIn

    Facebook
    LinkedIn

    Step 1– Head over & log in to Integrately. (https://app.integrately.com/login)

    Step2– Select the following apps for your automation: ‘Webhook / API Integration’ & ‘LinkedIn Ads’

    Step 3– Choose the following trigger action, then click ‘Go’:

    Trigger:

    Operation is performed in Webhook / API Integration

    Actions:

    Send conversion event in LinkedIn Ads

    Step 4– Now, you need to connect your app securely accounts with Integrately. For this, you must copy the webhook URL as shown below.

    Step 5– After copying the webhook URL, switch back to the code you earlier inserted in your GTM or website.

    Now, replace the “some_webhook_id_or_url” in your code with the actual webhook ID or URL obtained from Integrately.

    The ig.init() function in the code will then initialize your webhook URL or ID.

    Step 6– Also, your code must include which website events and data you need to send.

    The ‘ig.sendEvent()’ function in the code is used to transmit these event data to Integrately. This function accepts three arguments:

    • Event Name: The type of event being sent, e.g., “onclick”.
    • isForCookies: Determines whether to check for the presence of a cookie and if the cookie is present it will check for LinkedIn cookies before sending the event. It can be either true or false. If set to true, the event message will only be sent if the LinkedIn cookies are present; otherwise, it will be sent regardless. Example: For LinkedIn cookies, it will check for ‘li_fat_id’.

    Save and publish your changes before proceeding.

    Step 7– Head back to Integrately and click on ‘I have set this URL in Webhook / API Integration.’

    Step 8 – Follow the prompts to check the test records and securely connect your LinkedIn Ads account with Integrately.

    Step 9– After connecting your app accounts, you must map the desired fields to set up your automation.

    The required parameters/fields for LinkedIn Ads include:

    • Conversion ID
    • User First Party Cookie ID / Email

    Step 9-a : There are 2 ways to map the Conversion ID for LinkedIn:

    • Using Dropdown (Use this method when the Conversion ID is fixed):
      When you map the Conversion ID using dropdown, all the website events will be attributed only to that particular Conversion ID.

    • Mapping from the trigger app, i.e. webhook (Use this method when the Conversion ID is dynamic):
      To use this method, you must ensure the Conversion ID is sent via webhook.

    Step 9-b : Map the ‘Li Fat ID’ from the webhook as ‘User First Party Cookie ID’ in ‘LinkedIn Ads’

    Step 10 – Map other fields as per your requirements. Then, test and turn on your automation.

    Send conversion events from other apps to Facebook / LinkedIn

    Facebook
    LinkedIn

    Before you start sending conversions, you must setup a ‘Meta Pixel’ in Meta Events Manager.

    After setting it up, create an automation in Integrately to send conversions directly from other apps to Facebook.

    Step 1– Head over & log in to Integrately. (https://app.integrately.com/login)

    Step2– Select ‘Facebook Conversions’ & the other app you want to track conversions from.

    Step 3– Choose the conversion event you want to track as your trigger & select one of the following actions:

    • Send lead event in Facebook Conversions
    • Send purchase event in Facebook Conversions
    • Send other event in Facebook Conversions

    Step 4– Follow the prompts to securely connect your Facebook Conversions and the other app account with Integrately.

    Step 5– Map the data captured by your trigger app to the corresponding fields in Facebook Conversion.

    For the automation to run successfully, you must at least map the following:

    • Pixel ID
    • Action Source
    • Browser ID / Email

    Map other fields to suit your requirements.

    Step 6: Test and activate your automation:– Once everything’s mapped correctly, run a test to ensure data flows smoothly. If the test is successful, activate your automation to start tracking your conversions automatically.

    Before you start sending conversions, you must create a ‘Conversion Rule’ in LinkedIn Campaign Manager.

    Then, create an automation in Integrately to send conversions directly from other apps to LinkedIn Ads.

    Step 1– Head over & log in to Integrately. (https://app.integrately.com/login)

    Step2– Select ‘LinkedIn Ads’ & the other app you want to track conversions from.

    Step 3– Choose the conversion event you want to track as your trigger & select ‘Send conversion event in LinkedIn Ads’ as your action.

    Step 4– Follow the prompts to securely connect your LinkedIn Ads and the other app account with Integrately.

    Step 5– Map the data captured by your trigger app to the corresponding fields in LinkedIn Ads.

    For the automation to run successfully, you must at least map the following:

    • Conversion ID
    • User First Party Cookie ID / Email

    Map other fields to suit your requirements.

    Step 6: Test and activate your automation:– Once everything’s mapped correctly, run a test to ensure data flows smoothly. If the test is successful, activate your automation to start tracking your conversions automatically.

    Once you set up the automation, you can view your conversion tracking data directly in your Meta / LinkedIn Campaign Manager. This will give you valuable insights into your campaign effectiveness and help you optimize your ad spend.

    Abhishek Agrawal
    Author - Abhishek A Agrawal
    Abhishek is the founder of Integrately, CompanyHub, and Dreamwares. He is passionate about technology and entrepreneurship. He is always looking to leverage technology for the growth of the business. He has a deep understanding of how businesses work and uses this knowledge to build products that help entrepreneurs grow their businesses.

    Related Posts

    anybody-can-integrate
    Integrate Your Apps In 1 Click With Integrately
    • #1 Highest rated integration platform for non-techies
    • 20 Million+ ready automations
    • 3x-10x less expensive