How to use Google Tag Manager to trigger ConvertFlow in single-page apps

Some websites, often called single-page apps (SPA), don't fully reload when navigating between pages.

To have ConvertFlow detect the page change, you'll need to add the convertflow.start() function for ConvertFlow's JavaScript API, to tell ConvertFlow the page has changed and it needs to recheck CTA campaign targeting conditions.

Google Tag Manager does a great job at detecting single-page app page changes with its "History Change" trigger, so we can use Google Tag Manager to fire the ConvertFlow JavaScript API call whenever the page history changes, even if the page doesn't fully reload.

To set this up, add another GTM "Custom HTML" tag, that is separate of ConvertFlow's install script. Paste the script below in the HTML field.

  if (window.convertflow) {

Then, add the trigger called "Page History Change" to the tag. Save and publish the tag.

Assuming ConvertFlow is installed, GTM will now run that JavaScript API call whenever the page URL changes, even if it doesn't fully reload.