Deduplication

Warning

Deprecation Notice
The Marketing Version 202311 (Marketing November 2023) and earlier versions (excluding 202306 and 202307) have been sunset. Additionally, the unversioned APIs will be sunset soon. We recommend that you migrate to the versioned APIs as well as migrate to the new Content and Community Management APIs to avoid disruptions. See the Migration page for more details. If you haven’t yet migrated and have questions, submit a request on the LinkedIn Developer Support Portal.

Overview

We recommend that advertisers send events through both the Insight Tag, or the Image pixel, and Conversions API for increased reliability and a more complete view of the customer journey. If you are sharing the same events via multiple methods, also called a redundant set up, we may receive the same events from the browser and the server. Deduplication allows us to identify if the same events are being passed via multiple methods so we can discard the duplicate event and only count the conversion once.​
This document outlines the steps for setting up and using deduplication for the Insight Tag, or Image pixel, and Conversions API.

How Does Deduplication Work?

For any conversion that you want to send through multiple methods, such as Insight Tag and Conversions API, you must create a conversion rule for each data source (browser and server). Then, you can implement a logic to pick up the eventId from the browser and send it with the corresponding event from your server. If we receive an Insight Tag event and a Conversions API event from the same account with the same eventId, we discard the Conversions API event and count only the Insight Tag event in campaign reporting.

What Does Deduplication Look Like In Campaign Reporting?

Once you have set up a redundant conversion for Conversions API and Insight Tag and associated both conversions with a campaign:

  • You can see both conversions in reporting under the conversion breakdowns. For example, you can see “Insight Tag trial activation” and “CAPI trial activation”.
  • If we detect a redundant occurrence of an event, it is only counted once under the Insight Tag conversion and is deducted from the Conversions API conversion count. For example, if we detected that a “trial activation” was sent through both the Insight Tag and Conversions API, we will only count it under the “Insight Tag trial activation”.

Deduplication Status Monitoring

You must check that the Conversions API event and the Insight Tag event are showing up in your conversion breakdown and review the counts for each. Typically, the Insight Tag event will have a higher count if deduplication is working correctly.

Setting Up Deduplication On a Browser

The setup steps differ depending on how you installed your Insight Tag or Image pixel. You can follow one of the following methods to set up deduplication on the browser:

  • Manual installation method
    • Insight Tag Procedure
    • Image Pixel Procedure
  • Tag Manager installation method
    • Insight Tag Procedure
    • Image Pixel Procedure

Manual Installation Method

Insight Tag Procedure

  1. Page load conversions
    Assign the eventId to the _linkedin_event_id property on the global window namespace before the Insight Tag base code executes. For more information, see here.

    window._linkedin_event_id = "ABCDppSv6kBwg";
    

    Example
    An example of placing the script define _linkedin_event_id before the Insight Tag base code in advertiser codebase:

    
    // index.html
    // Define page load event ID before insight tag base code
    <html>
       <head>
          <script>
             window._linkedin_event_id = `very-unique-page-load-event-id`;
          </script>
          <!-- Insight Tag Code starts-->
          <script type="text/javascript">
             _linkedin_partner_id = "12345";
             window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
             window._linkedin_data_partner_ids.push(_linkedin_partner_id);
          </script><script type="text/javascript">
             (function(l) {
             if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};
             window.lintrk.q=[]}
             var s = document.getElementsByTagName("script")[0];
             var b = document.createElement("script");
             b.type = "text/javascript";b.async = true;
             b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
             s.parentNode.insertBefore(b, s);})(window.lintrk);
          </script>
          <noscript>
             <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=5041322&fmt=gif" />
          </noscript>
          </script>
          <!-- Insight Tag Code ends -->
       </head>
    </html>
    
  2. Event-specific conversions
    On the event performed by the user, invoke the window.lintrk function by passing in the event_id property along with the conversion_id in the second argument.

    window.lintrk("track", { conversion_id: 12345, event_id: "ABCDppSv6kBwg" })
    

Image Pixel Procedure

Pass the eventId into the image pixel URL.

<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=1&conversionId=123&fmt=gif&eventId=ABCDppSv6kBwg" />

Tag Manager Installation Method

LinkedIn Insight Tag 2.0 on Google Tag Manager can be extended to push the Event ID field for deduplication as mentioned in the following instructions.To add the LinkedIn Insight Tag 2.0 to Google Tag Manager, refer to the Help Center article. The GTM V2 template is extended to support the Event ID field for deduplication.

Insight Tag Procedure

Page load conversions

  1. Configure a GTM variable to read eventId from the data layer and plug it into the Event ID field in the template.

  2. Push eventId to the data layer before the GTM script executes.

    window.dataLayer = window.dataLayer || [];
     window.dataLayer.push({ eventId: 'ABCDppSv6kBwg'});
    

    Example
    Example of placing the script to define push the eventId to data layer before GTM script executes in advertiser codebase:

    // index.html
    // Push page load event ID to data layer GTM base code
    <html>
       <head>
          <script>
             window.dataLayer = window.dataLayer || [];
             window.dataLayer.push({ eventId: 'ABCDppSv6kBwg'});
          </script>
          <!-- Google Tag Manager starts-->
          <script type="text/javascript">
             (function (w, d, s, l, i) {
                  w[l] = w[l] || [];
                  w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
                  var f = d.getElementsByTagName(s)[0],
                    j = d.createElement(s),
                    dl = l != "dataLayer" ? "&l=" + l : "";
                  j.async = true;
                  j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
                  f.parentNode.insertBefore(j, f);
                })(window, document, "script", "dataLayer", "GTM-NP2LSDV");
          </script>
          <!-- Google Tag Manager ends -->
       </head>
    </html>
    

Event-Specific Conversions

  1. Configure a GTM variable to read eventId from the data layer and plug it into the Event ID field in the template.

  2. Configure conversion to trigger on a specific custom GTM event (e.g. contact).

  3. Push event and eventId to the data layer on any given user event.

      window.dataLayer.push({ event: 'contact', eventId: "ABCDppSv6kBwg" });
    

Image Pixel Instructions

The GTM V2 template does not support image pixel conversions. However, the eventId can still be specified by using a custom image tag as follows:

  1. Configure a GTM variable to read the image URL from the data layer and plug it into the “Image URL” field for the image tag.
  2. Configure conversion to trigger on a specific GTM event. For example, add_to_cart
  3. Push event and eventId to the data layer on any given user event.
dataLayer.push({ event: “add_to_cart”, pixliUrl: “https://px.ads.linkedin.com/collect/?pid=1&conversionId=123&fmt=gif&eventId=ABCDppSv6kBwg” })