Skip to content

Instantly share code, notes, and snippets.

@GaryUnbounce
GaryUnbounce / FancyBox
Created February 18, 2014 22:20
Add a lightbox style window (for privacy policy, rules, terms, etc)
<script>
$(document).ready(function() {
$('#lp-pom-text-22 a').fancybox({
type: 'iframe',
width: 840,
height: 480
});
});
</script>
@GaryUnbounce
GaryUnbounce / GA_ButtonClick
Created February 18, 2014 22:07
Tracking Button Click with Google Analytics (classic)
<script>
$( '#lp-pom-button-23' ).click( function(event) {
event.preventDefault();
var buttonLink = $(this).attr("href");
var callbackFunction = function(){
window.location = buttonLink;
}
@GaryUnbounce
GaryUnbounce / UA_ButtonClick
Created February 18, 2014 22:04
Tracking Click-Through Button Clicks with Universal Analytics
<script>
$( '#lp-pom-button-23' ).click( function(event) {
event.preventDefault();
var buttonLink = $(this).attr("href");
if (typeof ga != 'function') {
window.location = buttonLink;
}
@GaryUnbounce
GaryUnbounce / UA_FormClick
Last active August 29, 2015 13:56
Tracking Form Submission Buttons Clicks with Universal Analytics
<script>
$( '.lp-pom-form .lp-pom-button' ).click(function() {
if (lp.jQuery('form').valid() == true) {
ga('send', 'event', 'form', 'button', 'submit');
}
});
</script>
<style type="text/css">
.lp-pom-form-field .hint {
color:#999999 !important; /* Grey */
}
</style>
<script type="text/javascript">
jQuery(document).ready(function() {
var hints = {
"name": "John Doe",
"email": "you@youremail.com",
"phone_number": "555-555-5555",
"company": "Company Name"
};
var hideHint = function(field, text){