Skip to main content
All CollectionsTracking Links
Integrate Tracking Links with Calendly
Integrate Tracking Links with Calendly

How to integrate Euler tracking links with Calendly

David Link avatar
Written by David Link
Updated over a week ago

This article assumes you've already set up the Euler tracking script on your website. If you haven't, please start here.

Update Calendly

Calendly does not offer hidden fields. To track partner attribution, you'll need to add a text field to your Calendly form. Most folks call this field either Source or Referred by.

Regardless of the field name, you need to pay attention to the question's listed order. In our example below partnerId is listed as the second question, denoted by Q2. To populate this field, we'll take the value of 2 and use that in the next step.

Adding JavaScript to your Site

Before the closing </body> tag on your site. Use the following script to target the URLs on the page that link out to your calendly booking page. For this to work, you must change two things in the script below.

  1. Replace *this would be the URL the button is directing to* with the actual URL target ie. https://calendly.com/eulerdave/30min

  2. Replace *the number of the question from Calendly* with the question number you created in the Updated Calendly step above. In our example, that would 2.

<script>
document.addEventListener("DOMContentLoaded", function() {
function getCookieValue(name) {
let matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}

const eidCookieValue = getCookieValue('eidCookie');

if (eidCookieValue) {
const links = document.querySelectorAll('a[href="[*this would be the URL the button is directing to*]"]');
links.forEach(link => {
link.href += `?a*the number of the question from Calendly*=${eidCookieValue}`;
});
}
});
</script>

Testing

To test, you'll need to ensure the eidCookie is being set and passed through as a URL parameter. The easiest way to do this testing is to use an affiliate link you created inside Euler.

If you haven't created an affiliate link to use for testing, you can find information on how to create affiliate links here.

As you click through to select a time in Calendly, you'll find the unique partner identifier, which is the value of the cookie prepopulated in the source field you've created on your Calendly form.

Troubleshooting

The most common issue we see when setting up this integration is running conflicting JavaScript on your website. We recommend always starting with reviewing the scripts that are currently running and which might conflict.

The other common issue we see is simply using the correct question location on the Calendly form. It's important to note, reordering the questions will break the script. If the question was previously listed as Q2 in Calendly and moves to Q3, you'll need to update the script to annotate the new position as 3. You'll find an example of that below:

link.href += `?a3=${eidCookieValue}`; 

For any additional questions or help troubleshooting, please reach out. We're always here to help!

Did this answer your question?