Skip to content

Instantly share code, notes, and snippets.

View johnnyopao's full-sized avatar
✌️

Johnny Opao johnnyopao

✌️
View GitHub Profile
@johnnyopao
johnnyopao / conversionClick.html
Last active December 15, 2022 11:42
This works to trigger a Unbounce Conversion for buttons that do not navigate away but instead keep them on the same page
<script>
window.trackConversion = function() {
$('body').append('<iframe src="clkg/http/unbouncepages.com/blankpage/" style="display: none"></iframe>');
};
lp.jQuery(function($) {
$('#lp-pom-button-11').click(function () {
trackConversion();
});
@johnnyopao
johnnyopao / formExtConversionClick.html
Created May 13, 2015 23:55
Atrribute conversion on form submission to previous Unbounce page
<script type="text/javascript">
function yourSubmitFunction(e, $) {
e.preventDefault();
var _ubaq = _ubaq || [];
_ubaq.push(['trackGoal', 'convert']);
var ub_script = document.createElement('script');
ub_script.type = 'text/javascript';
ub_script.src =
@johnnyopao
johnnyopao / adwordsClickConversion.html
Last active December 15, 2022 11:42
Trigger Adwords Click Conversion (Placement: Before body end tag)
// This also requires a adwords onhandler conversion script.
// See the section on 'Tracking clicks on links or buttons as conversions' in the article below
// on how to obtain that script
// https://support.google.com/adwords/answer/6095821?hl=en
<script>
$( "#lp-pom-button-15" ).click(function(event) {
event.preventDefault();
@johnnyopao
johnnyopao / ubcalltrackingbuttonlinks.html
Last active December 15, 2022 11:42
Unbounce - Adwords Call tracking - Clickable button links backup - See full instructions here: http://documentation.unbounce.com/hc/en-us/articles/203509834
@johnnyopao
johnnyopao / ubcalltrackinglinks.html
Last active December 15, 2022 11:42
Unbounce - Adwords Call tracking - Clickable links backup - See full instructions here: http://documentation.unbounce.com/hc/en-us/articles/203509834
@johnnyopao
johnnyopao / confirmEmailValidation.html
Last active March 31, 2024 10:03
Confirm Email Validation
<script>
lp.jQuery(function($) {
var ruleID = 'emailMatch';
//The email field to check against
var firstEmailField = 'email';
//The second confirmation email field
@johnnyopao
johnnyopao / dropdownformconfirmationurl.md
Last active December 15, 2022 11:42
Change form destination URL by dropdown selection on Unbounce
  1. Be sure to first change your forms confirmation to 'Goto another webpage' and set a default fallback URL

  2. Drop this script into your javascript box. Set the placement to 'before body end tag'

<script>

$("#gender").live('change', function() {
 
 switch ($(this).val()) {
@johnnyopao
johnnyopao / urlparamanchor.html
Last active December 15, 2022 11:42
Pass URL parameters to Unbounce links containing Anchors
<script>
$(function() {
$('.lp-pom-image a, .lp-pom-text a, .lp-pom-button').not('a[href^=#]').each( function() {
var currentURL = this.href;
var hashIndex = currentURL.indexOf("#");
var hasAnchor = hashIndex > -1;
var hashString = "";
var baseURL = this.href;
@johnnyopao
johnnyopao / currencyValidation.html
Last active December 15, 2022 11:42
This validates a field for currency for dollar and cents. Ex: 42.50
<script>
lp.jQuery(function($) {
var ruleID = 'currency';
var field = 'money_field';
var message = 'Please enter a valid currency';
var rules = module.lp.form.data.validationRules[field];
@johnnyopao
johnnyopao / unbounceFancybox.html
Created April 16, 2015 21:32
Updated Fancybox script
<script>
$(function() {
$('#lp-pom-button-22').fancybox({
type: 'iframe',
width: 840,
height: 480,
centerOnScroll: true,
onStart: function() {
$('#fancybox-content').css({overflow: 'scroll', '-webkit-overflow-scrolling': 'touch'});
}