Webflow sync, pageviews & more.
NEW
Answers

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

To add an event-specific pixel for LinkedIn tracking on a button click in Webflow without leading users to another URL for success, you can utilize LinkedIn's "LinkedIn Insight Tag" and use custom code within Webflow. Here's a step-by-step guide on how you can achieve this:

1. Get your LinkedIn Insight Tag code:
- Go to the LinkedIn Campaign Manager and navigate to the "Insight Tag" tab.
- Create a new Insight Tag if you haven't already or choose the correct one.
- Copy the "LinkedIn Insight Tag" code snippet provided by LinkedIn.

2. Add the LinkedIn Insight Tag code to your Webflow project:
- In your Webflow Designer, go to the "Project Settings" by clicking on the gear icon in the left sidebar.
- Click on the "Custom Code" tab.
- Paste the LinkedIn Insight Tag code snippet in the "Head Code" section.
- Save the changes.

3. Add a custom code to track button clicks:
- Identify the button element on which you want to trigger the LinkedIn event pixel.
- Select the button element and open the "Settings" panel on the right.
- Click on the "Add Field" button and choose "Attributes."
- Add a new attribute with the following details:
- Attribute name: `onClick` (without quotes)
- Attribute value: `linkedinEventTracking(event, 'eventName')` (without quotes)

4. Define the custom JavaScript function:
- Go to the "Custom Code" section in your Webflow project settings.
- Add a new JavaScript block inside the "Head Code" section or at the end of the "Body Code" section.
- Define the `linkedinEventTracking` function with the following code:

```javascript

```

5. Customize the function:
- By default, the code sample above uses the LinkedIn Insight Tag script provided by LinkedIn. If you have a custom script URL, make sure to update it in the `script.src` line.

6. Replace `'eventName'` with a descriptive name for your event. For example, if you want to track a "Contact Form Submission" event, you can use `'ContactFormSubmission'`.

By following these steps, a click on the button will trigger the `linkedinEventTracking` function, which in turn sends the LinkedIn event pixel without redirecting users to another URL. Make sure to replace `'eventName'` with relevant event names and customize the function according to your specific requirements.

Rate this answer

Other Webflow Questions