SiteBehaviour Docs
  • Get Started
    • Overview
    • Quick Start
    • Custom Events
  • Guides & Integrations
    • React
    • NextJS
    • Angular
    • VueJS
    • Wordpress
    • Shopify
    • Wix
  • Security Practices
    • When to avoid tracking?
    • "Complete Tracking" mode
  • PRIVACY
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  1. Guides & Integrations

React

PreviousCustom EventsNextNextJS

Last updated 11 months ago

Here are the easy steps to add the SiteBehaviour Tracking script to their React project.

Steps to Add Script to a React Project

  1. Go to your and click on the Settings button for your site.

  2. Go to the Tracking code tab.

  3. Click on Copy to copy the Tracking Code to your clipboard.

  4. Locate the public Folder.

  5. In your React project directory, find the public folder. This folder contains static files like index.html.

  6. Open the index.html file located in the public folder.

  7. Locate the closing </head> tag in the file.

  8. Paste the Tracking script just before the closing </head> tag in the index.html file.

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Other head content -->
    <script>
        // Your web analytics script here
    </script>
</head>
<body>
    <div id="root"></div>
</body>
</html>

9 . After allowing a couple of minutes for the update, check for statistics. We recommend visiting your website to ensure that your initial activity is accurately reflected on the .

SiteBehaviour Organisation's page
SiteBehaviour's Dashboard
SiteBehaviour Dashboard