Skip to main content
Use this option if you have access to your website’s HTML template (or a tag manager) and want to install the CutMeShort Analytics script directly.

Add the script to your site

Paste the script once on every page of your website, ideally inside the <head> tag so it can read the landing-page URL before the user navigates.
<script
  src="https://cut-me-short-public.s3.ap-south-1.amazonaws.com/dev/track_dev.js"
  defer
  data-domain="yourdomain"
></script>

Where to place it

  • Static HTML sites: put it in the shared layout file right before </head>.
  • Single-page apps (React/Vue/Next, etc.): put it in your app’s document/layout head so it loads on all routes.
  • Tag managers: create a Custom HTML tag that fires on All Pages.

What the script does

Once installed, the script:
  • Reads attribution from the landing URL: detects cms_rf in the query string (example: ?cms_rf=abc123).
  • Stores attribution as a first-party cookie: saves the value for 60 days, so conversions that happen later can still be attributed.
  • Exposes a global tracking object: makes the client SDK available under window._cms for debugging/verification.
  • Sends events with attribution attached: when your lead/sale events are fired, the stored cms_rf is included so the conversion is credited to the original CutMeShort link click.

Configuration options

You can pass the following attributes on the script tag:

data-api-host

Typeurl
Default"https://www.cutmeshort.com"
Example"https://api.yourdomain.com"
Changes the base URL used by the script to send tracking requests. This is useful if you use a reverse proxy to reduce adblocker impact.

data-domain

Typestring
Example"yourdomain"
Used to configure client-side click tracking for your CutMeShort referral link domain.

Verification

  1. Open your website, then open the browser console and run:
    • window._cms
  2. Visit a test landing page URL that includes cms_rf, for example:
    • https://your-site.com/?cms_rf=test
  3. Confirm a first‑party cookie is set (in your browser devtools under Application → Cookies).
If the checks fail, make sure:
  • The script is present in the <head> and not duplicated.
  • Your site (or CDN) is not serving a cached version of the page missing the script.

Next steps

After the script is installed, you can send Lead and Sale conversions from your backend (recommended) using the Attribution endpoints.