Skip to content

Instantly share code, notes, and snippets.

@RobertCam
RobertCam / remove-default-link-tracking.html
Created July 19, 2017 23:35
Unbounce remove default link tracking (but still track as a goal)
@RobertCam
RobertCam / exclude-from-script-manager.html
Last active March 30, 2021 15:45
Prevent a script from firing on an Unbounce page based on a URL
<script>
// Script will NOT fire on URLs containing "check"
// Change the below variable to look for a different string in the URL (You can add an entire URL)
var excludeFromSM = "check";
if (document.location.href.indexOf(excludeFromSM) === -1){
// Your code goes here
}
</script>
@RobertCam
RobertCam / geo-ip-db-ajax.html
Created June 27, 2017 03:37
Display a visitors location on an Unbounce page (country, city, region, and coordinates)
<script>
$.ajax({
url: "https://geoip-db.com/jsonp",
jsonpCallback: "callback",
dataType: "jsonp",
success: function( location ) {
var country = location.country_name;
var region = location.state;
var city = location.city;
var lat = location.latitude;
@RobertCam
RobertCam / already-submitted.html
Last active October 3, 2018 16:00
Use cookies to check if an Unbounce form has already been submitted
<script type="text/javascript">
/*
Unbounce Community :: Tips & Scripts :: Check if Form Already Submitted
TS:0002-04-086
***********************
Do not remove this section. It helps our team troubleshoot possible issues and track feature usage and adoption.
*/
// Set amount of time until cookie expires (in Minutes) and form can be submitted again
var minutes = 1;
@RobertCam
RobertCam / lb-on-scroll.html
Last active November 2, 2017 17:19
trigger an Unbounce lightbox on scroll
<script>
/*
Unbounce Community :: Tips & Scripts :: Open Lightbox on Scroll
TS:0002-04-085
***********************
Do not remove this section. It helps our team track useage of external workarounds.
*/
(function() {
// lightbox button ID
var btn = $("#lp-pom-button-31");
@RobertCam
RobertCam / save-partial-form-data.html
Last active November 2, 2017 17:21
Save partially completed form data in local storage
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/garlic.js/1.3.0/garlic-standalone.min.js"></script>
<script>
/**
* Do not remove this section. It helps our team track useage of external workarounds.
* TS:0002-04-081
*/
$("form").attr("data-persist", "garlic");
$("form").attr("data-destroy", "false");
</script>
@RobertCam
RobertCam / fixed-cta-scroll.html
Last active November 2, 2017 17:20
Add a fixed element to an Unbounce page and have it appear on scroll
<script>
/*
Unbounce Community :: Tips & Scripts :: Fixed CTA on Scroll
TS:0002-04-074
***********************
Do not remove this section. It helps our team track useage of external workarounds.
*/
(function() {
// Add ID of sticky CTA
@RobertCam
RobertCam / conditional-reveal-multiple-fields.html
Last active January 9, 2024 11:39
Conditionally reveal form fields based on dropdown selection in an Unbounce form
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script>
/*
Unbounce Community :: Tips & Scripts :: Conditional State/ Province Form Field Based on Dropdown
TS:0002-04-060
***********************
Do not remove this section. It helps our team track useage of external workarounds.
*/
(function(){
<script>
/*
Unbounce Community :: Tips & Scripts :: Carousel With A Box Widget
TS:0002-04-063
***********************
Do not remove this section. It helps our team track useage of external workarounds.
*/
// jQuery 2.2.4 requierd
// CDN link here - https://code.jquery.com/