Google Analytics is the most popular web analytics tool. It's very easy to add to your page. GA provides you advanced analytics dashboard where you can analyze incoming traffic. You get real-time analytics for free.
However, sometimes, you just want to have a simple dashboard where you can look up your app's statistics, especially when you want to track your in-app customers.
Logspot allows you to track any activity user does in your application. You can track browser visits, button clicks, sign-ups, or anything you can think of.
This article will show you have you can track page views with Logspot.
If you have a website that is not using the NPM, you can use our JS script. Embed the script in the <head>
section.
<script async data-logspot-pk="YOUR_PUBLIC_KEY" src="<https://cdn.logspot.io/lg.js>"></script>
In the case of React application, you need to put the tracking code
import Logspot from '@logspot/web'; Logspot.init({ publicKey: "YOUR_PUBLIC_KEY" }); ... export default App;
Now your React application is automatically tracking page views.
In your _app.js
, you can define the following code:
import Logspot from '@logspot/web'; function MyApp({ Component, pageProps }) { // Logspot needs to be inside useEffect, because it uses window object useEffect(() => { Logspot.init({ publicKey: "YOUR_PUBLIC_KEY" }); }, []); return <Component {...pageProps} />; } export default MyApp;
Start in under 2 minutes.
No credit card required.
Cancel anytime.
Subscribe to product updates
© Copyright 2023, All Rights Reserved by Logspot