Tracking Script Issues
Fix problems with the Adsu tracking script on your gym's website.
How the Tracking Script Works
The Adsu tracking script (t.js) is a lightweight JavaScript snippet that runs on your gym's website and landing pages. It captures page views, form submissions, UTM parameters, and Facebook click IDs (fbclid), then sends this data to Adsu's collection endpoint. This is how Adsu connects anonymous ad clicks to known contacts in your CRM.
If the tracking script is not working correctly, you will see fewer attributed leads in your dashboard and the matching engine will have less data to work with.
Verifying the Script Is Installed
The tracking script should be placed in the <head> section of every landing page you use for ads. Here is what the correct installation looks like:
<head>
<!-- Other head tags (meta, title, etc.) -->
<script
defer
src="https://adsu.ai/t.js"
data-location="YOUR_LOCATION_ID"
></script>
</head>Replace YOUR_LOCATION_ID with the actual location ID from your Adsu dashboard. You can find the exact snippet with your location ID pre-filled at Settings > Tracking.
Debugging Steps
Check that the script loads
Open your landing page in Chrome and open DevTools (right-click > Inspect, or press Ctrl+Shift+I / Cmd+Option+I). Go to the Network tab and filter for t.js. Reload the page. You should see a request for t.js with a 200 status code.
If you do not see the request, the script tag is either missing from the page or placed incorrectly. View the page source (Ctrl+U / Cmd+U) and search for t.js to confirm it is present.
Check for collection requests
In the Network tab, filter for /api/collect. You should see requests being sent when you load a page and when you submit a form. These are the tracking events being sent to Adsu.
If the t.js file loads but no /api/collect requests appear, the script may be blocked by a content security policy or the location ID might be incorrect.
Check the Console for errors
Switch to the Console tab in DevTools and look for any red error messages. Common errors include:
- CORS errors -- the tracking endpoint may be blocked by your website's security headers. See the CORS section below.
- 404 on t.js -- the script URL may be incorrect. Verify it points to
https://adsu.ai/t.js. - Network errors -- the browser could not reach the Adsu server. Check your internet connection and try again.
Common Issues
Script Not in the Head Tag
The tracking script must be in the <head> section of your page, not the <body>. Placing it in the body can cause it to load after the page renders, missing the initial page view event. Some page builders put custom scripts in the body by default -- check your builder's settings to ensure it goes in the head.
Wrong Location ID
Each location in Adsu has a unique ID. If you copy the script from one location but install it on a different location's website, the events will be associated with the wrong location. Double-check the data-location attribute matches the correct location ID from Settings > Tracking.
Ad Blockers
Browser ad blockers and privacy extensions (uBlock Origin, Ghostery, Privacy Badger) may block the tracking script or the collection endpoint. This affects a small percentage of visitors. There is no way to prevent this on the visitor's side, but it typically affects less than 10-15% of traffic.
Test in incognito mode
When debugging the tracking script, open an incognito window (Ctrl+Shift+N / Cmd+Shift+N) with extensions disabled. This rules out browser extensions as the cause of any issues. If the script works in incognito but not in your regular browser, an extension is interfering.
CORS Errors
If you see CORS (Cross-Origin Resource Sharing) errors in the console, it means the browser is blocking requests from your website to the Adsu collection endpoint. This can happen if:
- Your website has strict Content-Security-Policy headers that do not allow connections to
adsu.ai - A reverse proxy or CDN in front of your site is stripping or modifying CORS headers
To fix this, ensure your website's Content-Security-Policy allows connect-src https://adsu.ai and script-src https://adsu.ai.
Form Submissions Not Tracked
The tracking script listens for standard HTML form submission events. If your landing page uses a JavaScript framework that handles forms without triggering native submit events (e.g., React, Vue, or a custom AJAX form), the script may not detect submissions automatically.
In most cases, standard contact forms, booking forms, and opt-in forms work out of the box. If your specific form is not being tracked, contact support for guidance on triggering tracking events manually.
sendBeacon and Content-Type
The tracking script uses the browser's sendBeacon API for page unload events, which sends data with Content-Type: text/plain. This is standard browser behavior, not a bug. If your server or CDN is configured to block text/plain POST requests, it may interfere with tracking. Do not add restrictions on Content-Type for requests to /api/collect.
Verifying Tracking Is Working
After confirming the script is installed correctly, verify that events are reaching Adsu:
- Open your landing page in an incognito window
- Open DevTools and switch to the Network tab
- Reload the page -- you should see a
/api/collectrequest with a 200 or 204 response - Fill out and submit the form on the page
- You should see another
/api/collectrequest for the form submission event - Within a few minutes, the contact should appear in your Adsu dashboard under Dashboard > Contacts
If the network requests succeed but the contact does not appear in the dashboard, the matching engine may not have run yet. It processes new events every 30 minutes. You can trigger it manually from the Sync Status page.