305 Snippets
<10 Favourites
<10 Downloads

Set a cookie if the URL contains specific UTM parameters.

The below script checks the URL for specific UTM parameters and if found, saves a cookie…

om.Campaign.canLoad

document.addEventListener('om.Campaign.canLoad', function(event) { // This event is passed the Campaign object console.log(event.detail.Campaign); } );

om.Optin.error

document.addEventListener('om.Optin.error', function(event) { // This event is passed the Campaign object console.log(event.detail.Campaign); // This event is…

webhook code example updated

{ "lead": { "email": "[email protected]", "ipAddress": "1.2.3.4", "referrer": "https://optinmonster.com/", "timestamp": 1699985224, "privacyConsent": true, "firstName": "Archie", "lastName":…

om-nextjs14.js

'use client'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; export…

om-change-view.js

// Show the Yes/No view om{{id}}.changeView('yesno'); // Show the Optin view om{{id}}.changeView('optin'); // Show the Success…

And the Javascript to turn your HTML link into a MonsterLink v2

jQuery(document).ready(function($) { $('a[class*="campaign"]').addClass("manual-optin-trigger"); $('a[class*="campaign"]').attr("data-optin-slug", "pm6fnflhiocj7cge"); });

Remove Specific Campaign From Any URLs Containing a Specific URL Path

document.addEventListener('om.Campaign.startShow', function(event) { if(window.location.search.indexOf('shopping-cart') > -1) { // replace shopping-cart wtih your specific URL path var…

pause a video playing on campaign.show

document.addEventListener('om.Campaign.show', function(event) { if (event.detail.Campaign.id === "CAMPAIGN_ID") { // Add your own logic to pause video…

1 21 22 23 24 25 26