Analytics
Analytics Setup
Analytics is key to understanding your users and measuring the effects of your actions. We have included standard analytics tools in BOB Frontend to let you track users and get valuable insights into their behavior. This will help you build better products and increase your conversion rates.
Google Analytics
The root layout of the application has Google Analytics enabled by default.
Just add your Google Analytics ID (GA ID) to your .env
file:
Google Tag Manager
The root layout also has Google Tag Manager enabled by default.
Add your Google Tag Manager ID (GTM ID) to your .env
file:
Send important events to Google Tag Manager to properly track your conversions.
Sending Events to Google Tag Manager
To send an event to Google Tag Manager, import this function into your component:
Example – sending an event when a button is clicked:
Facebook Pixel
A custom Facebook Pixel component is ready to use.
Add your Facebook Pixel ID to your .env
file:
Sending Events to Facebook Pixel
To send events to Facebook Pixel in your app, use the trackFacebookPixelEvent
function.
Example – tracking a product page view:
More details about Facebook Pixel can be found in the official documentation.
X Pixel (formerly Twitter Pixel)
A custom X Pixel component is also available by default.
Add your X Pixel ID to your .env
file:
Sending Events to X Pixel
You can send events to X Pixel using the trackXPixelEvent
function.
Example – tracking a product page view:
This allows you to track traffic and important custom events like Purchases, Leads, etc.
You can find the full setup guide in X Pixel Documentation under: Event Code Implementation.