Objective
Add a LinkedIn event-specific code to your Hub to track conversions on gated assets in LinkedIn Campaign Manager.
Important
This article covers conversion tracking on Uberflip form submits. If you are looking to implement the site-wide Insight Tag from LinkedIn, see this article for instructions. Implementing this Insight Tag is required to perform any type of conversion tracking with LinkedIn.
Prerequisite: Setup Conversion Tracking Campaign in Manager
Before you can implement the tracking code on your Uberflip Hub, you'll need to create an Insight tag, event-specific tracking method conversion in LinkedIn Campaign Manager. To do so, follow the instructions in this article from LinkedIn:
LinkedIn: Set up Online Conversion tracking
Once you've set up your conversion using the Insight Tag, event-specific method, you should have a copy of its code snippet. It will look something like this:
window.lintrk('track', { conversion_id: XXXXXXX });
Your tracking code will have a unique ID after conversion_id to associate it to your campaign.
This is what it will look like in LinkedIn Campaign Manager when you are selecting the conversion method:
Set Up LinkedIn Conversion Tracking on Your Hub
Now that you have the tracking code, you can add it to your Hub using custom code. Follow the instructions below to set up the tracking code so that it fires when a Form CTA is submitted.
Create a code block and name it anything you'd like. For the placement of the code block, select 'Body Bottom'.
The basis of your code block will be the following:
<script>
window.addEventListener('uberflip.ctaFormSubmitSuccess', (ctaId, ctaData, ctaName) => {
window.lintrk('track', { conversion_id: XXXXXXX });
});
</script>
You'll need to swap out the conversion_id with the ID from the conversion campaign you setup in Campaign Manager.
Now all you have to do is save and enable your code block, and your Linkedin tracking pixel will be deployed on your Hub.
Form Specific Conversion Tracking
The instructions above would trigger the conversion tracking on all Form CTA submissions in a Hub. If you'd like to narrow it down to a specific form, the same steps can be taken but using the following code snippet instead:
<script>
window.addEventListener('uberflip.ctaFormSubmitSuccess', (ctaId, ctaData, ctaName) => {
if (ctaId.detail.caller.dataset.id == [INSERT FORM CTA ID) {
window.lintrk('track', { conversion_id: XXXXXXX });
}
});
</script>
You'll still swap out your conversion_id with the ID from your event in LinkedIn Campaign Manager. Where it says [INSERT FORM CTA ID] you will include the ID of the Uberflip Form CTA you want to trigger this conversion on. The Form CTA ID can be found in Uberflip by navigating to Calls-To-Action > Form Calls-To-Action and finding your CTA. There will be a CTA ID column in the table that denotes its unique ID.
Item Specific Conversion Tracking
If you'd like to trigger the conversion on a specific gated Item in your Hub, the same code snippet for firing on all Form CTAs can be used. The only difference is that you'd create the snippet in an Item-level code block. For instructions on setting this up, see the Item-Level Custom Code Blocks section in this article.