VueJS

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

Steps to Add Script to a Vue 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. In your Vue.js project directory, find the public folder. This folder contains the static files like index.html.

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

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

  7. Paste your web analytics script just before the closing </head> tag in the index.html file.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>YourVueApp</title>
    <!-- Other head content -->
    <script>
        // Your sitebehaviour tracking script here
    </script>
</head>
<body>
    <noscript>
        <strong>We're sorry but YourVueApp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
</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