FeaturesAnalytics

Setup

  • Add a new website on DataFast
    ShipFast members get 30% off all yearly plans ❤️
  • Paste the tracking script from DataFast in the main layout.js file.
  • (optional) Some adblockers block DataFast. To fix this, proxy the script through the nextjs /api.
    First add this to next.config.js:

    next.config.js

    1async rewrites() {
    2    return [
    3      {
    4        source: "/js/script.js",
    5        destination: "https://datafa.st/js/script.js",
    6      },
    7      {
    8        source: "/api/events",
    9        destination: "https://datafa.st/api/events",
    10      },
    11    ];
    12}
    Then update the DataFast tracking script in the the main layout.js file:

    layout.js

    1<script
    2    defer
    3    data-website-id="YOUR_WEBSITE_ID"
    4    data-domain="YOUR_DOMAIN"
    5    src="/js/script.js"
    6  ></script>

I use DataFast for traffic analytics & custom events. If you want to use another tool, remove the DataFast script in the layout.js file.