Swetrix Tracking integration for Next.js

Overview

Swetrix Next.js integration

Official Swetrix Analytics integration for Next.js.

Integration

Install

Run the following command to install in your project:

npm install @swetrix/nextjs

Or with yarn:

yarn add @swetrix/nextjs

Basic usage

You can now import, and use the Swetrix hook on your project:

// ./pages/_app.js

import { useSwetrix } from '@swetrix/nextjs'

function YourApp({ Component, pageProps }) {
  useSwetrix('YOUR_PROJECT_ID')

  return <Component {...pageProps} />
}

export default YourApp

Debug-mode

When developing in localhost, Swetrix does not send events to avoid using your quota.
You can enable debug mode to send events when testing things locally. It will also log messages to console.

// ./pages/_app.js

import { useSwetrix } from '@swetrix/nextjs'

function YourApp({ Component, pageProps }) {
  useSwetrix('YOUR_SITE_ID', {
    debug: true
  })

  return <Component {...pageProps} />
}

export default YourApp

Advanced options

useSwetrix hook accepts 3 parameters: PID, initOptions, pageViewsOptions.
See our documentation page for more details.
You can always contact us in case of any questions! :)

Contribution

Feel free to contribute to the source code by opening a pull requests.
For any questions, you can open an issue ticket, refer to our FAQs page or reach us at [email protected] \

Selfhosted API

If you are selfhosting the Swetrix-API, be sure to point the apiUrl parameter to: https://yourapiinstance.com/log

Donate

You can support the project by donating us at https://ko-fi.com/andriir
We can only run our services by once again asking for your financial support!

You might also like...

This shows NFT tracking in the certain wallet using express back-end.

nft-tracking-for-solana-wallet Express backend for NFT tracking in the certain wallet. Webhook for scraping secondary marketplace information for part

Nov 16, 2022

Open Source ATS (Applicant Tracking System)

Nueno - Open Source ATS Tech Stack Prisma NextAuth Tailwind CSS Jest ESlint Prettier Husky Lint-Staged Github Actions VSCode extensions Getting Starte

Dec 27, 2022

Using a Leap Motion Controller from Ultraleap for finger tracking in VRChat without mods

Using a Leap Motion Controller from Ultraleap for finger tracking in VRChat without mods

Leap Motion Controller finger tracking for VRChat OSC Using a Leap Motion Controller from Ultraleap for finger tracking in VRChat without mods. Descri

Dec 31, 2022

A website for tracking community support for BIP21 QR codes that support on-chain and lightning bitcoin payments.

BIP21 Microsite This is a WIP microsite to promote the usage of a BIP21 payment URI QR code that can include lightning invoices or offers. Wallet supp

Nov 27, 2022

Minimalistic bill tracker for those who despise tracking microtransactions.

Minimalistic bill tracker for those who despise tracking microtransactions.

🏡 Home Bills Minimalistic bill tracker for those who despise tracking microtransactions. 🏆 Goals & Milestones Goals 🔍 Track important data. Trackin

Dec 6, 2022

Nueno - Open Source ATS (Applicant Tracking System)

 Nueno - Open Source ATS (Applicant Tracking System)

Nueno - Open Source ATS (Applicant Tracking System) Project setup Database Duplicate env.example and .env.test.example and rename to .env and .env.tes

Dec 27, 2022

A daily activity tracking application that helps to organize your daily tasks and keep track of tasks that have been completed, or yet to be completed.

A daily activity tracking application that helps to organize your daily tasks and keep track of tasks that have been completed, or yet to be completed.

To-Do-List This is my To-Do List project in the Microverse curriculum. Built With HTML CSS Javascript (Webpack) GitHub Live Demo Live Demo Link Gettin

May 7, 2022

Well Read is a website for tracking your reading of long book series.

Well Read is a website for tracking your reading of long book series.

Read without losing the plot. Well Read helps you organize your notes about books you're reading, so you're never lost when starting a new volume.

Dec 15, 2022

A site for tracking your lost pets!

A site for tracking your lost pets!

Lost Pet Project Overview Once the USER is at the landing page of /home they can choose to login/sign-up or browse lost pets. If they want to login or

May 16, 2022
Comments
  • Open tasks

    Open tasks

    If you want to contribute to project, you can see your TODOs at https://github.com/orgs/Swetrix/projects/2 Also you can open any other pull requests with bug fixes or feature proposals.

    good first issue help wanted 
    opened by Blaumaus 0
Releases(v1.0.1)
Owner
Swetrix
Bringing privacy oriented web analytics services to the world
Swetrix
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Connect Web Integration illustrates the integration of Connect-Web in various JS frameworks and tooling

Connect Web Integration Connect Web Integration is a repository of example projects using Connect-Web with various JS frameworks and tooling. It provi

Buf 43 Dec 29, 2022
A Next.js 12 integration of GraphQL Server.

This is a Next.js 12 integration of GraphQL Server. It is early work and has not been extensively tested in production. It is based on samples provide

Arthur Puyou 15 Dec 29, 2022
A developer directory built on Next.js and MongoDB Atlas, deployed on Vercel with the Vercel + MongoDB integration.

MongoDB Starter – Developer Directory A developer directory built on Next.js and MongoDB Atlas, deployed on Vercel with the Vercel + MongoDB integrati

Vercel 246 Dec 20, 2022
Decentralized Social Media. Built using Next.js. Web3 integration with Moralis, Metamask and Ethers.js. Also uses Lens Protofcol to get the profile data.

DecentraGram Decentralized Social Media. Built using Next.js. Web3 integration with Moralis, Metamask and Ethers.js. Also uses Lens Protofcol to get t

Didier Peran Ganthier 8 Dec 20, 2022
Please do not use this tracker to scam anyone! This is free and will be forever free. This tracking will never ask for seed phrases nor private keys. Keep safe!

CryptoBlades Tracker Related modules express - web application framework for node pug - template engine stylus - pre-processor CSS mongoose - nodejs o

null 355 Oct 13, 2022
Webb-tracker-api - James Webb Space Telescope (JWST) tracking REST API

James Webb Telescope tracking REST API Public REST API to track JWST's current status API data source: https://www.jwst.nasa.gov/content/webbLaunch/wh

Aslan Vatsaev 67 Nov 22, 2022
Your personal budget tracking app.

Btracker Your personal budget tracking app. ?? Links Postman workspace Video Explanation Deployed Frontend Link Frontend Repository ?? Features Create

Fidal Mathew 2 Jan 29, 2022
Nutrition tracking software that uses machine learning to help you reach your body composition goals.

LogSmarter - Machine Learning Nutrition Tracker Description LogSmarter LogSmarter™ is not just another calorie counter. It is an AI nutrition coach th

Ryan Lefebvre 24 Sep 4, 2022