Analytics [PRO]
The boilerplate has analytics as well and uses the Analytics (opens in a new tab) package from David Wells which is a lightweight wrapper for many analytics tools. It is like Prisma for Analytics, so it's easy to connect to different analytics services at once and use it with the universal API.
The configuration is located at packages/analytics
.
Google Tag Manager Setup
-
Go to Google Tag Manager (opens in a new tab) and create an account for your project with the Web container type.
-
Note the container ID (starts with GTM-) and add it to the
.env
file.
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_CONTAINER_ID=
- Done! You might want to connect Tag Manager to Google Analytics. Refer to Tag Manager Help (opens in a new tab) to be able to see events in Google Analytics.
Since Google analytics tools use cookies, there is a requirement to have a cookie banner disclose tracking. Webappboost has the banner (with consent mode) implemented out of the box.
Refer to the Analytics docs (opens in a new tab) to see all available analytics provider plugins.