LinkedIn conversion tracking

In order to track conversions that happen on your Instapage experience inside your LinkedIn account, you will need to add the following pieces of code in the indicated places.

The following code needs to be placed inside the Javascript > Body section of the landing page (only once per variation): 

<script type="text/javascript">
var bodyElement = document.getElementsByTagName('body')[0];

bodyElement.insertAdjacentHTML( 'afterbegin','<div id="addImage"></div>');

var addImage = document.getElementById('addImage');

function LinkedInConversion () {
addImage.innerHTML += '<img height="1" width="1" style="display:none;" alt="" src="" />';

The value between the quotes, after the addImage.innerHTML +=  part, is the one that you will need to replace so that it matches the pixel code of your LinkedIn account. The value is the HTML code, and it needs to be placed inside the quotes, exactly as in the above example. 



Tracking form submissions as conversions:

Add the following code snippet in Javascript > Body under the first block of code. You do not need to edit anything else here, as the LinkedIn pixel is already edited in the first code snippet that is present at the top of this article.

<script type="text/javascript">
window.instapageFormSubmitSuccess = function( form ){

Tracking button clicks as conversions:

Add the following code snippet in Javascript > Body under the first block of code. You will need to edit the element ID of the button to match the ID of the particular button you are looking to track.

window.addEventListener('DOMContentLoaded', function () {
var element = document.querySelector("#element-123 .btn");
element.addEventListener("click", handler);
function handler() {


The implementation works only once per session (example: the visitor arrives on the page and performs an action - form submission or a button click - once the form is submitted or the button is clicked, the pixel will trigger and it will stay on the page). If the form is submitted again without the page being reloaded, the pixel will no longer trigger again.