Linkedin Tips & Strategies

How to Add LinkedIn Insight Tag to WordPress

By Spencer Lanoue
November 11, 2025

Tracking the true performance of your LinkedIn ads starts with a simple piece of JavaScript code. Installing the LinkedIn Insight Tag on your WordPress site closes the loop between ad clicks and actual business results, letting you measure conversions, retarget visitors, and get detailed demographic insights. This guide will walk you through exactly how to add the tag to your website using a plugin or manually adding code.

What is the LinkedIn Insight Tag and Why Do You Need It?

The LinkedIn Insight Tag is a lightweight snippet of JavaScript that you place on your website. Once installed, it adds a cookie to your visitor's browser, allowing LinkedIn to recognize them as someone who came from one of your campaigns. It’s an essential tool for any business advertising on the platform, and its power comes from three main capabilities:

  • Website Conversion Tracking: The tag allows you to track actions people take on your site after clicking your LinkedIn ad. This could be anything from a form submission, an eBook download, a product purchase, or signing up for a webinar. It connects a specific ad campaign directly to a valuable business outcome, helping you prove your marketing ROI.
  • Website Retargeting: You can create audiences of people who have visited specific pages on your website and then serve them customized follow-up ads on LinkedIn. For example, you can retarget anyone who viewed your pricing page but didn’t sign up, reminding them of your value proposition.
  • Website Demographics Reporting: Because the tag connects your website traffic to LinkedIn's professional data, you can see aggregated demographic information about your visitors right inside Campaign Manager. This includes powerful insights like job titles, company industries, seniority levels, company sizes, and more, all without capturing any personally identifiable information.

In short, without the Insight Tag, you’re flying blind. You can see how many people click your ads, but you have no idea what they do afterward. Installing the tag illuminates that customer journey and transforms LinkedIn ads from a guessing game into a measurable marketing channel.

How to Find Your LinkedIn Insight Tag

Before you can add the tag to WordPress, you first need to get the code from your LinkedIn Campaign Manager. The process is straightforward and only takes a minute.

Here’s how to locate your unique code snippet:

  1. Log in to your LinkedIn Campaign Manager account.
  2. From the main dashboard, click on the correct ad account.
  3. In the top navigation bar, click on Analyze and then select Insight Tag from the dropdown menu.
  4. If you've never set up the tag before, you'll be prompted to do so. In the installation section that pops up, choose your preferred method. We'll be using this with WordPress, so simply choose "I will install the tag myself".
  5. A code box will appear with the JavaScript snippet. This is your Insight Tag. Every ad account has a unique tag ID embedded in the code.

It will look something like this:

<,script type="text/javascript">,
_linkedin_partner_id = "1234567",
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=1234567&,fmt=gif" />,
<,/noscript>,

Click the Copy code button to copy the entire snippet to your clipboard. Now you’re ready to add it to your WordPress site.

Three Ways to Add the LinkedIn Insight Tag to WordPress

There are multiple ways to install the Insight Tag on a WordPress site. We’ll cover the three most common methods, ranging from the non-technical-friendly plugin approach to more advanced methods for those comfortable with code. For most users, the plugin method is the safest and easiest option.

Method 1: Using a Plugin (The Easiest Way)

Using a dedicated plugin to manage scripts is the recommended approach for anyone who isn’t comfortable editing theme files directly. It's clean, simple, and you don’t have to worry about accidentally breaking your site or losing your changes when you update your theme.

Our favorite for this is the WPCode – Insert Headers and Footers plugin.

Step-by-Step Instructions:

  1. From your WordPress dashboard, navigate to Plugins >, Add New.
  2. In the search bar, type “WPCode Insert Headers and Footers.”
  3. When you find the plugin by WPCode, click Install Now and then Activate.
  4. Once activated, you will find a new menu item in your dashboard called Code Snippets. Hover over it and click on the Header &, Footer menu.
  5. You'll see a few empty boxes. LinkedIn recommends placing the Insight Tag in the global site header. Paste the entire JavaScript snippet you copied from Campaign Manager into the Header box.
  6. Click the Save Changes button in the top right corner.

That’s it! The plugin will now automatically inject the Insight Tag code into the <,head>, section of every page on your website, which is exactly where LinkedIn wants it to be.

Method 2: Adding Code to Your Theme's functions.php File

For those who prefer to keep their plugin list lean, you can add the Insight Tag directly to your theme’s functions.php file. Always use a child theme for this! If you edit the parent theme directly, your code will be erased the next time the theme is updated.

Important Note Before You Begin:

Editing your theme's files can break your site if done incorrectly. It's a good idea to back up your website before proceeding. If you're not comfortable with this, stick with Method 1.

Step-by-Step Instructions:

  1. In your WordPress dashboard, go to Appearance >, Theme File Editor.
  2. On the right side of the screen, make sure you have your child theme selected.
  3. Find and click on the Theme Functions (functions.php) file to open it in the editor.
  4. Scroll to the bottom of the file and add the following lines of PHP code. Be sure to replace the placeholder comment with your actual Insight Tag code.

function add_linkedin_insight_tag_header() {
?>,
<,!-- PASTE YOUR LINKEDIN INSIGHT TAG CODE HERE -->,
<,?php
}
add_action( 'wp_head', 'add_linkedin_insight_tag_header' ),

Your Insight Tag code goes in between the ?>, and <,?php lines.

  1. Click the Update File button at the bottom.

This code tells WordPress to hook into the wp_head action - which runs when WordPress constructs the <,head>, section of your site - and inject your custom function, which contains the tag. The result is the same as the plugin method, but without adding another plugin.

Method 3: Editing the header.php File Directly (Use With Caution)

This method involves editing your theme’s header.php template file directly. This is the least recommended approach because it’s the most fragile. Like the functions.php method, you must use a child theme. Even with a child theme, this method is less ideal because it creates a template override that might break if the parent theme changes its header.php structure in a future update.

Step-by-Step Instructions:

  1. Go to Appearance >, Theme File Editor and select your child theme.
  2. Find and open the Theme Header (header.php) file. If your child theme doesn't have one, you'll need to copy it from the parent theme directory into your child theme directory first.
  3. Look for the closing <,/head>, tag within the file.
  4. Paste your LinkedIn Insight Tag code on a new line just before the <,/head>, tag.
  5. Click Update File.

How to Verify Your LinkedIn Insight Tag Is Working

After installing the tag, you need to make sure it's firing correctly. LinkedIn gives you a simple way to check this right from your ad account, but you can also use your browser's developer tools for a more technical look.

Check Your Status in LinkedIn Campaign Manager

The easiest way to verify is to head back to the Insight Tag section within your LinkedIn Campaign Manager (Analyze >, Insight Tag). After installing the code and visiting a few pages on your site, your domain should appear in the list with a status signal.

  • It can take a few minutes or even a couple of hours for LinkedIn to register your tag for the first time.
  • When LinkedIn receives a signal from your website, you'll see a green "Active" notice next to your domain. This confirms that everything is working perfectly.

Use Your Browser's Developer Tools

For an instant check, you can use the built-in developer tools in browsers like Google Chrome.

  1. Go to your website.
  2. Right-click anywhere on the page and select Inspect to open the developer tools.
  3. Click on the Network tab.
  4. In the filter box, type `linkedin`.
  5. Refresh your webpage.

If the tag is installed correctly, you should see at least one successful request show up in the list with a name containing `px.ads.linkedin.com`. The status should be `200`, indicating a normal signal.

Setting Up Conversion Tracking (The Next Step)

Just having the sitewide tag installed is great for analytics and retargeting, but the biggest benefits come from tracking specific actions. This is called conversion tracking, and it’s how you’ll measure the real impact of your ad spend.

For example, you could track when a user submits a contact form by counting a conversion every time someone lands on your "thank you" page. Here's a high-level overview of how to set that up:

  1. In LinkedIn Campaign Manager, go back to Analyze >, Conversions.
  2. Click Create conversion >, Online Conversion.
  3. Give your conversion a name, like "Whitepaper Download Confirmation."
  4. Define your conversion event. For a thank-you page, you'd choose Page load.
  5. For the rule, you'll specify the URL of your confirmation page (e.g., "URL contains 'thank-you'").
  6. Attach this conversion to one or more of your active advertising campaigns.

Once you save and activate this conversion, LinkedIn will start tracking every time a user who has previously clicked on one of your ads lands on that specific page. Now your campaign reporting won't just show clicks - it will show tangible leads and results.

Final Thoughts

Installing the LinkedIn Insight Tag on your WordPress site unlocks the true power of your advertising efforts, providing a direct line of sight from ad spend to real-world business results. Whether you use a simple plugin or add the code manually, getting it in place puts you ahead of the curve and empowers you to make smarter, data-driven marketing decisions.

As you get deeper into both your paid and organic social strategies, clean analytics become essential. That's why at Postbase, we designed our platform with a clear and simple analytics dashboard right at its core. Seeing exactly what organic LinkedIn content drives engagement - alongside performance data from other platforms - helps you fine-tune your messaging and understand your audience on a deeper level. It provides the organic strategy insights that perfectly complement the data from your ad campaigns, creating a fully integrated approach to social media marketing.

Spencer's spent a decade building products at companies like Buffer, UserTesting, and Bump Health. He's spent years in the weeds of social media management—scheduling posts, analyzing performance, coordinating teams. At Postbase, he's building tools to automate the busywork so you can focus on creating great content.

Other posts you might like

How to Add Social Media Icons to an Email Signature

Enhance your email signature by adding social media icons. Discover step-by-step instructions to turn every email into a powerful marketing tool.

Read more

How to Record Audio for Instagram Reels

Record clear audio for Instagram Reels with this guide. Learn actionable steps to create professional-sounding audio, using just your phone or upgraded gear.

Read more

How to Check Instagram Profile Interactions

Check your Instagram profile interactions to see what your audience loves. Discover where to find these insights and use them to make smarter content decisions.

Read more

How to Request a Username on Instagram

Requesting an Instagram username? Learn strategies from trademark claims to negotiation for securing your ideal handle. Get the steps to boost your brand today!

Read more

How to Attract a Target Audience on Instagram

Attract your ideal audience on Instagram with our guide. Discover steps to define, find, and engage followers who buy and believe in your brand.

Read more

How to Turn On Instagram Insights

Activate Instagram Insights to boost your content strategy. Learn how to turn it on, what to analyze, and use data to grow your account effectively.

Read more

Stop wrestling with outdated social media tools

Wrestling with social media? It doesn’t have to be this hard. Plan your content, schedule posts, respond to comments, and analyze performance — all in one simple, easy-to-use tool.

Schedule your first post
The simplest way to manage your social media
Rating