Product Requirements |
Custom HTML, CSS, or JavaScript is insertable when designing a Build your own campaign. Inserting the code allows users to influence the campaign's design and behavior beyond what is available by default.
Things to know
- Custom code is not available to users of Privy Free accounts.
- Custom code is not available in campaigns created using Plays.
- Custom code is only recommended for users with proficiency in the topic or those with access to a developer. Without a complete understanding of your site, custom code targeting your campaigns can impact your site pages. For this reason, Privy's support team is unable to help you create or customize campaigns with code beyond the general guidance covered in this guide.
Insert the code
To insert custom code into a Build your own campaign:
- Navigate to Convert > All Campaigns and select or create a campaign with a display.
- In the Create step, select the first Design option to access the campaign editor.
- Select the Add element option from the sidebar, followed by the Add HTML option from the subsequent dropdown menu.
- Select the new HTML element from the sidebar's Elements list.
- Add the desired HTML, CSS, or JavaScript code into the element's editing area.
- Select the Save option at the upper right when you are done with your changes.
In the example shown below, the custom CSS included in the element removed the "X" option from the bar campaign. This design change means the announcement cannot be dismissed.
Common uses
Remove the closing "X" from the corner of a campaign.
<style>
.privy-dismiss-content {
display: none;
}
</style>
Remove the shadow design from a campaign's button.
<style>
.privy-element.privy-button-element.privy-button-flat {
box-shadow: 0 0px !important;
}
</style>