How can I add an event-specific pixel for Linkedin tracking on button click in Webflow without leading users to another URL for success?

TL;DR
  • Create a LinkedIn event-specific pixel and obtain the pixel ID.
  • In Webflow, access button settings and add a custom attribute with inline JavaScript to fire the pixel.
  • Publish and test the site to ensure the pixel fires correctly upon button click.

To track button clicks with a LinkedIn event-specific pixel in Webflow without leading users to a new URL, follow these steps:

1. Create Your LinkedIn Event-Specific Pixel

  • Log in to your LinkedIn Campaign Manager account.
  • Navigate to the Account Assets tab and select Insight Tag.
  • Create a new event-specific pixel, capturing the pixel ID for later use.

2. Access the Button Settings in Webflow

  • Open your Webflow project and locate the button you want to track.
  • Select the button and go to the Settings panel.

3. Use Custom Code to Trigger the Pixel

  • In the Settings of the button, locate the Custom Attributes section.
  • Add a custom attribute with the key as onclick and the following value (replace YOURPIXELID with the actual pixel ID):
  • javascript:linkedinInights.tag('track', {conversionId: 'YOURPIXELID'});
  • Save the changes.

4. Test the Implementation

  • Publish your site to see the changes live.
  • Click the tracked button to ensure the pixel fires as expected.

Summary

Use custom attributes on your Webflow button to fire a LinkedIn event-specific pixel via inline JavaScript without redirecting users. This ensures you capture the event without navigating away.

Rate this answer

Other Webflow Questions