om.Campaign.init.preload
document.addEventListener(‘om.Campaign.init.preload’, function(event) { var campaign = event.detail.Campaign; campaign.settings.preload = false; });Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
document.addEventListener(‘om.Campaign.init.preload’, function(event) { var campaign = event.detail.Campaign; campaign.settings.preload = false; });Continue reading
const queryString = window.location.search; // capture all query args document.addEventListener(‘om.Dtr.init’, function(event) { // use this event instead if added directly through the OM campaign builder // document.addEventListener(‘om.Campaign.load’, function(event) { // Registers {{query_args}} smart tag that outputs all query args from…Continue reading
document.addEventListener(‘om.Dtr.init’, function(event) { console.log(event.detail.Dtr); console.log(event.detail.Campaign); // Registers a custom `name` smart tag. event.detail.Dtr.setCustomVariable(‘name’, ‘Thomas’); } );Continue reading
document.addEventListener( ‘om.GoogleAnalytics.preConversionEvent’, function( event ) { const { gaEvent } = event.detail; gaEvent.params.your_param1 = param1value; gaEvent.params.your_param2 = param2value; } );Continue reading
document.addEventListener( ‘om.GoogleAnalytics.preConversionEvent’, function( event ) { const { gaEvent } = event.detail; gaEvent.name = ‘generate_lead’; // generate lead is a recommended event } );Continue reading
// OptinMonster Javascript Event for Google Analytics Impression Event document.addEventListener( ‘om.GoogleAnalytics.preImpressionEvent’, function( event ) { var ga = event.detail.GoogleAnalytics; var campaign = event.detail.Campaign; var gaEvent = event.detail.gaEvent; if ( ‘YOUR_CAMPAIGN_ID’ !== campaign.id ) { return; } // custom code goes…Continue reading
// OptinMonster Javascript Event for Google Analytics Conversion Event document.addEventListener( ‘om.GoogleAnalytics.preConversionEvent’, function( event ) { var ga = event.detail.GoogleAnalytics; var campaign = event.detail.Campaign; var gaEvent = event.detail.gaEvent; if ( ‘YOUR_CAMPAIGN_ID’ !== campaign.id ) { return; } // custom code goes…Continue reading
// Set OptinMonster Global Cookies when this function runs function setGlobalCookies() { document.cookie = “omSuccessCookie=true; expires=Fri, 31 Dec 9999 23:59:59 GMT”; document.cookie = “omGlobalSuccessCookie=true; expires=Fri, 31 Dec 9999 23:59:59 GMT”; document.cookie = “omGlobalInteractionCookie=true; expires=Fri, 31 Dec 9999 23:59:59 GMT”; }Continue reading
// Using Ember.js. import Route from ‘@ember/routing/route’; export default Route.extend({ beforeModel(transition) { if (window.om5678_1234) { window.om5678_1234.reset(); } } });Continue reading
import ‘@/app/ui/global.css’; import {RouteChangeListener} from ‘@/app/route-change-listener.tsx’; export default function RootLayout({ children, }: { children: React.ReactNode; }) { return ( {children} ); }Continue reading