Nuxt

Whether you're a Nuxt.js expert or just starting with the framework, this documentation provides a snippet and instructions tailored specifically for Nuxt.js to ensure a smooth integration process.

Walkthrough

  1. In your Nuxt.js project, locate the app.vue file where you want to connect the custom script.

  2. Open the file and paste your script (see the instructions how to get the script in Cookie3) below the <template> closing bracket

  3. Your app.vue file should look as following:

<template>Hello World!</template>
<script>
export default {
  setup() {
    useHead({
      script: [
        {
          innerHTML: `    
          
      const cookie3Options = {"siteId": YOUR_SITE_ID,"additionalTracking":true,"cookielessEnabled":true}

      window._paq = window._paq || [];
      (function () {
          var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
          g.async = true; g.src = 'https://cdn.cookie3.co/scripts/analytics/latest/cookie3.analytics.min.js'; s.parentNode.insertBefore(g, s);
      })();`,
        },
      ],
    });
  },
};
</script>
  1. Save the changes.

Checking the script status

After connecting the custom script to your website, make sure to deploy/save/update your production code.

  1. Once the production code is updated, open a web browser and visit app.cookie3.co/website/manage.

  2. Check the Connection status for your website in the table row.

  3. If the status is 'Connected,' congratulations!

  4. If the status is 'Not connected,' click on the refresh icon to attempt to establish the connection again.

  5. If the connection still fails, please reach out to our support team for further assistance.

Congratulations! You have successfully connected the Cookie3 Script to your website. You can now leverage advanced tracking and analytics features for your website.

Last updated