305 Snippets
<10 Favourites
<10 Downloads

Dynamic Monsterlinks By Class Name

// Target by class name window.onload = function(){ const dynamicMonsterLinks = document.querySelectorAll("a.myClass"); dynamicMonsterLinks.forEach(dynamicMonsterLinks => dynamicMonsterLinks.href =…

om.Campaign.init.preload2

document.addEventListener('om.Campaign.init.preload', function(event) { var campaign = event.detail.Campaign; if ({slug} === campaign.id) { campaign.settings.preload = false; }…

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.Campaign.close example

document.addEventListener('om.Campaign.close', function(event) { const url = "http://optinmonster.com"; window.location.href = url; } );

Style Just OptinMonster Campaign Placeholders

html div#om-{{id}} ::-webkit-input-placeholder { color: #333 !important; } /* Chrome/Opera/Safari */ html div#om-{{id}} ::-moz-placeholder { color:…

floating-monsterlink-2

  Want to get 25,000 unique visitors a month? Click here to learn how

change view yes/no

om{{id}}.changeView('yesno');

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…

1 2 3 4 26