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
‘use client’; import { usePathname } from ‘next/navigation’; import { useEffect, useState } from ‘react’; export function RouteChangeListener() { const pathname = usePathname(); const [changes, setChanges] = useState(0); useEffect(() => { if (window.om5678_1234) { window.om5678_1234.reset(); } setChanges((prev) => prev +…Continue reading