Skip to content

Instantly share code, notes, and snippets.

@RobertCam
Last active November 2, 2017 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertCam/3ef7334bd4a6b1d274f7c888dfeada3f to your computer and use it in GitHub Desktop.
Save RobertCam/3ef7334bd4a6b1d274f7c888dfeada3f to your computer and use it in GitHub Desktop.
<script>
/*
Unbounce Community :: Tips & Scripts :: Use DTR and Track Which Button Opens a Lightbox
TS:0002-04-057
***********************
Do not remove this section. It helps our team track useage of external workarounds.
*/
var params = window.location.search;
var character = "&";
if (params == ""){
character = "?";
}
$("#lp-pom-button-322").click(function() { // Add Id of button
var url = $(this).attr('href').split("?")[0];
$(this).attr("href", url + params + character + "plan=Bronze"); // add parameters to pass through to lightbox
});
$("#lp-pom-button-323").click(function() { // Add Id of button
var url = $(this).attr('href').split("?")[0]
$(this).attr("href", url + params + character + "plan=Silver"); // add parameters to pass through to lightbox
});
$("#lp-pom-button-324").click(function() { // Add Id of button
var url = $(this).attr('href').split("?")[0]
$(this).attr("href", url + params + character + "plan=Gold"); // add parameters to pass through to lightbox
});
$("#lp-pom-button-325").click(function() { // Add Id of button
var url = $(this).attr('href').split("?")[0]
$(this).attr("href", url + params + character + "plan=Platinum"); // add parameters to pass through to lightbox
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment