Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

How do I add LinkedIn conversion tag in a form?


icamefromtheocean

Question

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

You add the linked in pixel. Best place to do this is probably in the page footer code injection part. (you'd need business/premium for this as it's javascript). For your form conversion you need to add a conversion event in LinkedIn campaign manager. this gives you some javascript to execute, which you'll have to hook up with a code block.

installing the pixel

Probably best to do this in the code injection part.

  • Get your pixel code from the LinkedIN Campaign Manager: Account Assets > Insight Tag. Go to the Install Tag section and expand "I will install this myself". Copy that code in its entirety.
  • In Squarespace go to Settings > Advanced > Code Injection, and paste the code into the Footer section, click Save

installing a conversion

Set up your conversion in the LinkedIn Campaign Manager. Account Assets > Conversions. See here: Set Up LinkedIn Conversion Tracking | Marketing Solutions Help

  • In step 3, make sure you select Insight Tag, and then Event from the Track dropdown
  • Copy the code at the bottom of that page. it will look like this: window.lintrk('track', { conversion_id: xxx })
  • Now go to the page where your form is and add a code block after the form
  • we need to attach the li tracking code to the button, so add the below code to that code block (but insert your own conversion_id from step above.
<script>
  const btn = document.querySelector("form input[type=submit]");
  if (btn && btn.addEventListener) { 
  	btn.addEventListener("click",function() { 
      window.lintrk('click',{ conversion_id: xxxxxxx }); 
    });
  }
</script>
  • this assumes you've only got one form on your page. if you've got more than one you'll need to find the block ID of your form (use the Squarespace Block ID chrome extension) and add that before the form in the query selector

 

There are other alternatives for link tracking if you're not using the LI pixel. you can use Squarespace's marketing section to build urls for LinkedIn Ads, and then look at tracking sources etc. you can also add hidden inputs to your form during the form design process and set the variable names to ss_source and ss_campaign_name and then the form will have the campaign submitted with it.

Creating trackable links – Squarespace Help

 

Dave Hart. Software/Technology Consultant living in London

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...