React

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 SiteBehaviour Organisation's page 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 SiteBehaviour's Dashboard for statistics. We recommend visiting your website to ensure that your initial activity is accurately reflected on the SiteBehaviour Dashboard.

Last updated