Skip to guide
Docs & Help
Ctrl / ⌘ K
Installation guides

How to install Attriboo on Remix / React Router

Install Attriboo in the root HTML document used by Remix or React Router framework mode. Put it in the shared head, rather than a route that disappears during navigation.

Instructions reviewed

Before you start

This method covers Remix v2 and React Router framework projects with an app/root.tsx document. A React Router app using Vite’s index.html should follow the React/Vite guide instead.

Add the published domain in Attriboo. Keep one tracking installation and preserve your site’s consent choices. Your website ID is public; private API keys do not belong in the page script.

Copy the script for this website

  1. Choose your website in Attriboo.

    Check the address in the website selector. Add the website first if it is not listed.

  2. Open Setup and choose Remix / React Router.

    Under Add the tracking script to your website, find Where is your site built? Choose this platform, then use Copy beside Your code. This gives you the right code format with your website ID filled in.

Add Attriboo to Remix / React Router

Find this setting

  1. Application source
  2. app/root.tsx
  3. Document <head>
  4. Deploy
  1. Open app/root.tsx and find the component that renders html, head and body.

    It may be an exported Layout component.

  2. Add the JSX script from Setup inside that head.

    Keep Meta, Links, Outlet, Scripts and ScrollRestoration where the application needs them.

  3. Deploy the app and check a direct page load plus client-side links.

    If the app uses a Content Security Policy nonce, have its developer include the same approved nonce on this script.

Code format example. Copy your filled-in version from Attriboo Setup.
<script defer data-site-id="site_YOUR_WEBSITE_ID" src="https://www.attriboo.com/t.js"></script>

Check this platform’s behavior

Do not paste an HTML document over the existing root file. Add the script element only. Resource/API routes that return JSON do not render this document and are not browser pages to track.

Check that page visits reach Attriboo

  1. Open the published website in another tab.

    Use the address your customers visit. Make your normal tracking choice if a consent banner appears.

  2. Return to the same website in Attriboo → Setup.

    Select Test Connection. Look for a successful result such as Verified Live or activity on the correct address.

  3. Follow an internal link, then use your browser’s Back button.

    Check those paths in the Pages view for the current reporting dates. Allow the reports to refresh. An active connection alone does not confirm every page change.

Connect visits to recorded revenue

Installing the script records website activity. To bring sales into Attriboo, connect the service you use to collect payments in Setup as well. Then compare the recorded sources and customer journeys behind your sales.

A payment imported from before tracking was installed may have no matching visit. Installing today does not recreate old website activity.

Remix / React Router references

These placement instructions were reviewed against the platform’s documentation and Attriboo’s current tracker. Check the published site after deployment, theme changes or navigation changes.

You are done when

The published Remix / React Router site loads one Attriboo tracker and the expected page visits reach the selected website. Sales reporting is checked separately.

Still need a hand?

Send a question without needing to sign in.

Open support form