Embedding LinkedIn Insight Tag & Conversion Tracking on Your Website

LinkedIn's Insight Tag and conversion tracking are powerful tools for understanding and optimizing your website's engagement with LinkedIn ads. Whether you're running a basic HTML site, a Shopify store, or a WordPress site, integrating these snippets can help you measure conversions and improve your advertising efforts on LinkedIn. Here's a step-by-step guide on how to embed these tags into your website so you may begin gauging the efficacy of the ads you are creating.

For HTML Websites

Step 1: Obtain the LinkedIn Insight Tag

  • Log in to your LinkedIn Campaign Manager.
  • Select your account.
  • Click on the "Analyze" dropdown and select "Insight Tag".
  • You'll see the option to "Install my Insight tag". Click it, and select "I will install the tag myself" to reveal the tag code.
<!-- LinkedIn Insight Tag Code -->
<script type="text/javascript">
_linkedin_partner_id = "your_partner_id";
window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
</script><script type="text/javascript">
(function(l) {
if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};
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);
<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=your_partner_id&fmt=gif" />
<!-- End LinkedIn Insight Tag Code -->

Step 2: Embed the Insight Tag

  • Copy the LinkedIn Insight Tag script.
  • Paste it just before the closing `</body>` tag of your HTML.
  • Replace “your_partner_id”

Step 3: Setup Conversion Tracking

  • After embedding the Insight Tag, identify the conversion actions on your site (e.g., form submissions, downloads, or page visits).
  • For each conversion action, add the following trigger snippet immediately after the Insight Tag code on the page where the conversion occurs:
<script type="text/javascript">
lintrk('track', { conversion_id: your_conversion_id });

For Shopify Stores

Step 1: Add the LinkedIn Insight Tag to Your Shopify Store

  • From your Shopify admin, go to Online Store > Themes.
  • Find the theme you want to edit, and then click Actions > Edit code.
  • Under the Layout section, click theme.liquid to edit it.
  • Paste the LinkedIn Insight Tag code just before the closing </body> tag.

Step 2: Implement Conversion Tracking

  • To track conversions, such as a purchase or a signup, locate the file that corresponds to the action. For example, for tracking purchases, edit the thankyou.liquid file located under Templates.
  • Insert the conversion tracking trigger snippet right after the Insight Tag code in the thankyou.liquid file or any other relevant file.

For WordPress Sites

Step 1: Add the LinkedIn Insight Tag

  • Navigate to your WordPress dashboard.
  • Go to Appearance > Theme Editor.
  • Select your active theme and find the footer.php file.
  • Paste the LinkedIn Insight Tag script just before the closing </body> tag.

Step 2: Implement Conversion Tracking

  • For conversion tracking, install a plugin that allows custom JavaScript, such as "Insert Headers and Footers" or "Custom JavaScript Editor".
  • Using the plugin settings, add the conversion tracking trigger snippet to the pages where conversions occur, following the plugin's instructions for adding scripts.

In Closing

Integrating the LinkedIn Insight Tag and conversion tracking into your website is a straightforward process that can significantly enhance your LinkedIn marketing efforts. By following the steps outlined above for HTML websites, Shopify stores, and WordPress sites, you can start tracking conversions and gaining valuable insights into how users interact with your site from LinkedIn.

Remember to regularly check your LinkedIn Campaign Manager to analyze the performance of your ads and make data-driven decisions to optimize your campaigns.

Download this guide as a PDF