How to add conversion pixels, javascript and custom CSS

Adding conversion pixels & scripts

As a marketer, you'll want to make sure you're tracking conversions in your advertising platforms. 

ConvertFlow makes it easy to integrate conversion pixels into your CTAs, and only fire your conversion pixels at the right time.

To add javascript and conversion pixels to a form, button or survey, select it in the builder and click "Confirmation Actions" in the builder panel.

Then click the "Edit Code" button to paste your custom scripts, which will only fire when that form, button or survey is completed.

Adding javascript and CSS to steps

You can also add your own custom javascript and CSS to run when a step of your CTA is reached.

This is useful for tracking view events in other analytics platforms. It's also useful if you need to add custom CSS for your CTA content.

Pro tip: Because ConvertFlow's CTAs are HTML on your site, like any other content on your site, custom code added to the CTA builder can inherit CSS classes and javascript functions from your website's libraries.

To add javascript and/or CSS to a step, click to edit the step from the builder panel, then click "Edit Code", and you can add your custom code.

The added javascript or CSS will be added to the end of the body tag. ( Why can't I add scripts to the head?)

ConvertFlow's CTA content is dynamically loaded in using Javascript, based on rules such as conditions, split-testing, personalization etc.

Because it's not server-rendered HTML, which is evaluated upon the first rendering before javascript runs, we don't add custom scripts to the head. 

Custom scripts added through ConvertFlow's script manager get added to the end of the body tag, reflecting the actual load order that the script was added to the page.

This may not align with script installation instructions from various tracking script / conversion pixel providers, which tend to default to instructing installing their script in the head. However it should not cause errors, or prevent event tracking, unless their script needs to be ran synchronously.

Handling errors

Any errors from custom javascript, added using ConvertFlow's custom script managers, will be caught and logged in the javascript console as a message with the stack trace accessible. 

This ensures there is no interruption to ConvertFlow's functionality, data processing and your visitors' ConvertFlow experience. The downside of this is errors from your custom scripts may not be logged in your website's javascript profiling tools.