Calendly makes it easy for your website visitors to schedule a meeting in your exisiting Google or Microsoft calendar. Integrate Calendly with Leadtosale to see which meetings result in sales and use this data to optimise your advertising.
Calendly setup
There are two requirements to setup integration with Leadtosale:
- Have a paid Calendly Pro account
- Redirect invitees after scheduling to a custom confirmation page on your website
Leadtosale setup
We are going to use a Leadtosale Custom Event Tracker to create a lead from the custom confirmation page on your website.
First ensure you have a Custom Event Tracker created in your Leadtosale container.
Next add the following code to your custom confirmation page. You can do this directly on the page or via Google Tag Manager.
<script>
(function(){
var rocket = location.search.substring(1);
var christmas = JSON.parse('{"' + rocket.replace(/&/g, '","').replace(/=/g,'":"') + '"}', function(key, value) { return key===""?value:decodeURIComponent(value) })
if (typeof(document.createLead) === 'function') {
document.createLead(christmas);
} else {
document.addEventListener('ltsCustomLeadReady', function () {
document.createLead(christmas);
}
)
}
})();
</script>
Testing
You can test the integration by visiting your thank you page in a web browser with an email address parameter in the URL (eg. example.com/thanks?email=test@leadto.sale). You should instantly see a lead created in Leadtosale. If you do not please:
- Ensure the main Leadtosale tracking script is also on the webpage
- Contact Leadtosale with the URL of your thank you page
The integration will work no matter how the meeting is booked (widget, Calendly website or email signature link, etc) so long as you have configured the custom confirmation page for meeting type. If a user has not visited your website they will show with a traffic source of direct/none in Leadtosale and Google Analytics.
How it works
Calendly automatically sends the meeting details to your website thank you page as parameters at the end of the URL. The JavaScript gets the URL parameters then checks that Leadtosale is loaded on your website. If Leadtosale is ready we create a new lead, if not we tell the web browser to wait for Leadtosale then create a new lead.