squatch.js & 1st-Party Cookies
As of June 2020, SaaSquatch has enabled the usage of 1st Party Cookies to accommodate a wider industry shift towards the increased protection of end user privacy.
🔗 1st-Party Cookie Overview
Previously, SaaSquatch sharelinks placed a cookie on our SaaSquatch domain before redirecting to a campaign's designated landing page. Because present and upcoming changes to browser behaviour restricts the use of 3rd-party cookies, a 1st-party cookie based on UTM parameters passed through the URL from SaaSquatch is required instead to maintain functionality.
This is done by placing squatch.js on your landing page so it can read the UTM parameters and create a valid 1st-party cookie. As these are 1st-party cookies, they are in full compliance with all browsers.
While existing 3rd-party cookie functionality will continue to perform as expected with compatible browsers, we highly recommend ensuring that 1st-party cookies can be detected.
🔗 squatch.js Functionality
As of June 2020, squatch.js performs these additional functions:
- It reads
_saasquatchfrom the URL and stores a 1st-party cookie on the specified landing page's domain.
- It automatically sets the
cookiesfield on users during an upsert.
- It reads the 1st-party cookie during use of
🔗 Attribution Preference Hierarchy
As there are several ways to attribute a Referred User to a Referrer, the connection will always be linked following the below scheme:
- Explicit inclusion of a
referredByCodeseither via squatch.js or the REST API will always override any identified cookie.
- If a referral code is not included directly with a user upsert, squatch.js will look for the 1st-party cookie and make the attribution.
- If no 1st-party cookie exists and a 3rd-party cookie is available through a compatible browser, the 3rd-party cookie will be detected and applied.
🔗 Notes for Customer Implementations
We recommend that all implementations that make use of our referral cookie adhere to the following instructions to enable usage of 1st-party cookies:
- squatch.js must be placed on your landing page -- this sets the 1st-party cookie.
- squatch.js must additionally be placed on your signup page where your users are upserted -- this reads the 1st-party cookie.
- Most importantly, your landing page and your signup page must exist on the same domain.
Note to existing implementations: As of June 2020, Apple is the only company that is completely restricting the behaviour of 3rd-party cookies, meaning that Safari and iOS users on the latest versions are unable to use referral programs that make use of SaaSquatch cookies.
While Chrome and Firefox still allow certain 3rd-party cookies to be used, it is expected that they will be further restricting use in future updates. To ensure maximum compatibility for your end-users, regardless of the browser they are using, we highly recommend performing this update to your site.