Last active
September 22, 2020 10:22
-
-
Save multiplehats/98f47a14d514ac69b51c572099565e14 to your computer and use it in GitHub Desktop.
Deadline Funnel x EverWebinar
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
<script> | |
/** | |
* Everwebinar x Deadline Funnel | |
* Checks for the Everwebinar Product Offers Popup (Settings >> Live >> Product Offers) and adds the email from the attendee to the URL. | |
* If no email is present it will default to the sales link set in the Product Offers setting. | |
* Ideally the link you set in the Product Offers setting is the DLF link without the ?em= query string in the URL. | |
* As confirmed by the DLF team, this will create a new tracking for that user. However, if that user clicks on an email later on, those 2 trackings will be merged into one. | |
* | |
* Author: Chris Jayden - chrisjayden.com | |
**/ | |
jQuery(document).ready(function($){ | |
var attendeeProperties = window.localConfiguration, | |
everwebinarSalesPopupBtn = ".attendee_slide_up_block .tab-content a", | |
deadlineSalesPageLink = "https://dfl0.us/s/12345678?em="; // Change to your sales page DLF link | |
if (typeof attendeeProperties != "undefined") { | |
var deadlineEmail = attendeeProperties.me.email; | |
if ( deadlineEmail ) { | |
var deadlineLink = deadlineSalesPageLink + deadlineEmail; | |
var everwebinarSalesPopup = setInterval(function() { | |
if ( $( everwebinarSalesPopupBtn ).length ) { | |
var btn = $(this); | |
clearInterval( everwebinarSalesPopup ); | |
$( everwebinarSalesPopupBtn ).prop("href", deadlineLink); | |
console.log("Found attendee's email, set Deadline Link: " + deadlineLink); | |
} | |
}, 500 ); | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The sales popup in Everwebinar is added dynamically (as in, it doesn't exist yet in the browser). This script will check every 500ms if the sales popup exists. And if it does, it will get the attendee's email address, and adds it to the Deadline Funnel link. if no email is present for whatever reason (unlikely) it will default to the link set in your Everwebinar settings.
To be added in Integrations >> 3rd Party Tracking Systems >> Webinar live room tracking