React, Vite or Create React App

Single page apps.

For a React app, put the line in the HTML file the app loads into. Route changes are picked up by the script, so every screen is counted.

Steps

  1. Open index.html (Vite: in the project root; Create React App: in the public folder).

  2. Inside the head, paste:

    <script defer data-site-id="YOUR-SITE-ID" src="https://spintaxifycms.com/js/analytics.js"></script>
    
  3. Build and deploy.

Check it works

Open your site in a normal browser window (not one where you are logged in as admin, if you excluded admin pages). Then open Analytics in Spintaxify. Within a few seconds Online now shows 1, and the setup card ticks Install the script.

Tip: your site ID is in Analytics → Settings → General. Copy the snippet from there and it is already filled in.

Something missing? Contact us and tell us what you were looking for.