Calendly integration
Calendly is the modern scheduling platform that makes “finding time” a breeze. When connecting is easy, your teams can get more done.
To track form submissions you can use an additional option of event – Confirmation Page. The section allows you to set a redirection to an external site and then to resend event details to it. The integration uses this.
Initial setup
The first step is to edit the event you want to track and setting up redirection in the Confirmation Page section. You will have to add a special code to the redirection page so choose wisely. The final touch is to enable ‘Pass event details to your redirected page‘ as that is the key for being able to track submission details.
Redirection URL
As mentioned above, to be able to track a submissions there has to be a special code added to this page. In general you have two options. You can use PHP code to read GET data Calendly is sending to the redirection URL or you can use JavaScript. JavaScript is a client code so it has to be added to the site code while PHP is a server side code which will have to process the GET parameters first, prepare the sale tracking code and then push the result to client.
For easier showcase let’s focus on JavaScript. You will need something like this:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
var urlParams = new URLSearchParams(window.location.search);
function getVarFromUrl(name) {
if (urlParams.get(name) != null) {
return urlParams.get(name);
}
return '';
}
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('0');
sale.setOrderID(getVarFromUrl('invitee_email'));
sale.setProductID(getVarFromUrl('event_type_name'));
sale.setData1(getVarFromUrl('invitee_email'));
PostAffTracker.register();
</script>
The above code will use JavaScript native object ‘URLSearchParams’ to parse the URL into separate parameters. The sale tracking code itself then uses a custom function ‘getVarFromUrl()’ to get value of a defined parameter.
To find out parameter names of your form you have to make at least one test submission and then see the parameter names in redirected URL. Then just use getVarFromUrl(‘name’) in the sale tracking code.
That’s it. Your submissions will be tracked from now on. Make sure to integrate your site with the click tracking code and make sure the landing page is at the same domain as your redirection URL.