This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
$(document).on('OptinMonsterBeforeOptin', function(event, data, object){ | |
// Grab the email address submitted by the user. | |
var email = $('#om-' + data.optin).find('input[type="email"]').val(); | |
// Test to ensure it is a proper email. Otherwise, redirect to another page. | |
if ( /@yahoo.com$/.test(email) || /@gmail.com$/.test(email) || /@hotmail.com$/.test(email) || /@googlemail.com$/.test(email) || /@live.com$/.test(email) || /@aol.com$/.test(email) || /@outlook.com$/.test(email) || /@comcast.net$/.test(email) || /@inbox.com$/.test(email) || /@hushmail.com$/.test(email) || /@lycos.com$/.test(email) || /@zoho.com$/.test(email) || /@gmx.com$/.test(email) ) { | |
window[data.optin_js].optin = function(){ | |
return window.location.href = 'http://optinmonster.com/'; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
//Snag the URL of the iframe so we can use it later | |
var url = $('.optin_custom_html_applied iframe').attr('src'); | |
$(document).on('OptinMonsterOnClose', function( event, data, object){ | |
//Assign the iframe's src to null, which kills the video | |
$('.optin_custom_html_applied iframe').attr('src', ''); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
$(document).on('OptinMonsterTracked', function( event, data, object ){ | |
console.log(data.optin + '-' + data.type + " successfully tracked"); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
$(document).on('OptinMonsterTrackedImpression', function( event, data, object ){ | |
console.log(data.optin + '-' + data.type + ' successfully tracked an impression.'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
$(document).on('OptinMonsterTrackedImpression', function( event, data, object ){ | |
console.log('A successful conversion is about to be made for the ' + data.optin + '-' + data.type + ' optin.'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($) { | |
$(document).on('OptinMonsterTrackedConversion', function( event, data, object ){ | |
dataLayer.push({ | |
'event': 'gaTriggerEvent', | |
'gaEventCategory': 'form', | |
'gaEventAction': 'submit', | |
'gaEventLabel': 'optin-monster' | |
}); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
$(document).on('OptinMonsterOnError', function(event, data, object){ | |
var l = 20; | |
for( var i = 0; i < 10; i++ ) | |
$( ".optin-monster-error" ).animate( { 'margin-left': "+=" + ( l = -l ) + 'px' }, 50); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
$(document).on('OptinMonsterOptinSuccess', function( event, data, object ){ | |
object.close(); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function($){ | |
$(document).on('OptinMonsterOnRedirect', function(event, data, object){ | |
console.log(“Redirect in progress..”); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function SaveToDisk forces file download instead of viewing in browser | |
function SaveToDisk(fileURL, fileName) { | |
// for non-IE | |
if (!window.ActiveXObject) { | |
var save = document.createElement('a'); | |
save.href = fileURL; | |
save.target = '_blank'; | |
save.download = fileName || 'unknown'; | |
var event = document.createEvent('Event'); |