Prepare the campaign
To properly trigger the campaign without conflicts:
- Navigate to Convert.
- Select the campaign you'd like to trigger.
- Navigate to the Create step of the campaign builder.
- Make sure the Tab Design setting is set to No tab.
- Navigate to the Target step of the campaign builder.
- Select the When To Show section and ensure all the Automatically Show settings are disabled.
- Save the changes and Publish the campaign.
Create and apply the function
- Take note of the URL displayed when viewing the campaign page and copy the number listed after /campaigns. This is the campaign's ID.
- Add the function listed below to your site's HTML to create the button. Make sure to replace "XYZ" with your campaign number, update the button text, and to style the button so that it matches your site's branding.
<button onClick="Privy('show', XYZ);">Attend Our Event</button>
See it in use
Once you add the button to your content, a visitor's click will trigger the campaign: