LInkedIn Custom Event Tracking

Bronze Contributor
Bronze Contributor

Hello, I am trying to track custom conversions inside LinkedIn Insightin Pixel. I am getting used to tracking event functions inside the tag itself. I am used to using individual triggers from GTM. I am looking for the data mapping I am supposed to use inside the LinkedIn tag to fire Event Tracking from LinkedIn.

LinkedIn gives me a conversionID I am supposed to use too. I don't really see a way to map that in the data mappings of the LinkedIn Insight tag. The src matches where the library loads in, so I was hoping to do this in the tag itself.

<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=323497&conversionId=378793&fmt=gif" />

I am trying to configure this specific tag/pixel to fire when a user clicks a certain link that takes them out of our property. So I believe this will have to use the utag.link() function somehow.

So I was thinking I either load a Tealium Generic Image Tag and then modify the template to accept 'u.ev = {"link" : 1};' and then set the load rules to match certain data elements like event_name = "outbound_click". I am setting the event_name in the extension tab globally.

Or I would set a JS extension that contains the image syntax with a condition that matches my event_name == "outbound_click".

2 REPLIES 2

LInkedIn Custom Event Tracking

Tealium Expert
Tealium Expert

You could add the click track tag as a new tag (generic image tag template), with an impossible load rule. (we usually use something like page_name is not defined)

The add a click handler using the onHandler template.  Set it to custom, and call

utag.link(utag_data, null, ["xx"]) 

where xx is the UID of your tag.

This will cause a utag.link call on your button click which will only trigger this one tag (it will bypass all other extensions and load rules)

LInkedIn Custom Event Tracking

Tealium Expert
Tealium Expert

The main problem you're going to get here is that if you only attempt to load the tag on the click, @brett-bold, the browser isn't going to have enough time to fetch the utag.x.js file and then drop the pixel on the page before it aborts all outstanding network requests and navigates on to the next page.

You could speed that bit up by creating a UDO element that effectively detects whether a qualifying link is available on the page, potentially writing that to utag_data at DOM Ready. So long as the tag itself is scoped only to a link event, the pageview will load the tag but won't fire the tag. Then use a tag-scoped JS extension that identifies ineligible click events, and suppresses the tag firing for those. Something like:

if(b.event_name != "outbound_click") return false;

That will then abort the tag send if the link event wasn't an outbound click event.

Alternatively, bundle the tag so that you don't need to load it remotely on the page. Either way works, and should cut down the network traffic and give you a better chance of punching through.

The ideal approach would be to either:

  1. Open off-site links in a new window, giving the old window all the time it needs to complete its various tag sends, or
  2. Use an event listener on the link clicks to prevent the default navigation behaviour for a brief period while tag firing takes place, and then navigate the customer onward after say 800ms (which should be enough for an SSL handshake etc.) - it's bad customer experience, and requires messing with the site a little, but it'll work

In general, firing off network requests when the browser is trying to navigate off the current page is always risky - if the HTTPS handshake to LinkedIn hasn't completed before the browser gets a response from the page it's navigating to, it'll abort the request and the payload will never reach the LinkedIn data collection server, which will impact your conversion metrics on certain (faster) browsers.

Public