Website Snippet

Reach attributes revenue to marketing activities using a business’s first-party data – we provide a lightweight javascript snippet that can be injected onto a customer’s public-facing landing page and tracks when a user lands on a business’s website (after clicking on a marketing link) and then later identifies themselves on that same site.

Basic Installation

Please ensure you load this javascript snippet on every page in your app. Add the script to the <head> section of your HTML and for optimal performance, place it as early as possible. Embedding this snippet requires two parameters:
  • PARTNER_HASH – a short, public-facing identifier assigned to your vertical SaaS platform by Reach. This will always be the same value – you can hard-code it into your application.
  • TENANT_EXTERNAL_ID – the unique, case-sensitive business ID you use to identify businesses in your platform. Ideally, this is a value you already have available on any web pages that you host for your clients. Note: you will onboard the business to Reach when they opt-in to using Reach’s services in the Management UI.
<script src="https://public.embedreach.com/scripts/:PARTNER_HASH/:TENANT_EXTERNAL_ID/analytics.js"></script>
Please get in touch with our team if you have any questions about the best way to load the script if you’re using your particular web development framework.

Content Security Policy (CSP) Considerations

If you have implemented a strict Content Security Policy (CSP) you may need to update it for the Reach app to be successful. The script is loaded from https://public.embedreach.com and makes requests to https://api.embedreach.com. Assuming no other scripts on your website, an example strict CSP would look like this:
Content-Security-Policy:
script-src 'self' https://public.embedreach.com;
connect-src 'self' https://api.embedreach.com;

Onboarding Businesses to Reach

Businesses will be automatically onboarded when they opt-in to using Reach’s services in the Management UI. The externalId used here should be the same as the externalId passed in as onBusinessCreate() in the Management UI documentation. If your platform does not manage website creation and management on behalf of your clients, they will be shown instructions during Reach’s onboarding flow for how to inject the snippet on the most common website creators.

Cross-Domain Attribution

Sometimes, what looks like one website is actually on multiple domains – some common versions of this:
  • Client owns their website / landing page, but they redirect to another page hosted by the vertical SaaS platform (e.g. “online ordering”) where a user will put in their contact information.
  • Client owns their website / landing page, but they embed an iframe hosted by the vertical SaaS platform (e.g. “request an estimate” or “schedule a call” form) where a user will put in their contact information.
The Reach attribution snippet will automatically handle cross-domain attribution for these use-cases as long as it is embedded on both sites. During the implementation process with Reach, please let the team know the domain your platform uses for these “identification” pages to ensure this works correctly.

Advanced Usage

The snippet is designed to support capturing several different types of form submissions. If you have a non-standard configuration that cannot be captured by the Reach snippet, you can use javascript to trigger an identification. Some examples of where this may be necessary:
  • The identification information is only available through a JavaScript event, such as a message from an iframe that does not have conversion tracking code (e.g. HubSpot Meetings, Acuity Scheduler)
  • You want more control over which fields are sent to Reach and when
// Make sure this code is placed within a script tag AFTER the reach script is loaded
window.reach.createIdentification({
  email: 'test@example.com',
  phone: '+12223334444',
  f_name: 'test',
  l_name: 'example',
  // choose a meaningful name for each unique action that could trigger an identification
  source_id: 'appointment-scheduling-system',
});

Error Handling

The script is designed to fail gracefully – no additional error handling is required at this time. Please reach out to our team if you have any concerns.