How to Implement Smartlook to a Next.js Project
Smartlook is an analytics platform tool for web and mobile applications. The platform supports a detailed analysis of applications by allowing developers to view recorded user sessions through the eyes of visitors.
Several integration systems are offered by Smartlook, namely through the Mobile SDK and Website SDK through Drupal, Joomla, Wix, Google Tag Manager, WordPress, and Shopify as well as integration of other plugins. It doesn't stop there, Smartlook can also be installed on Next. js-based projects.
The first thing that is important to do is to register and include the website URL on the Smartlook dashboard. Then download the Smartlook Client via https://www.npmjs.com/package/smartlook-client or via npm
npm i smartlook-client
Then include the following code on the /_app.js page
import React, { useEffect, useState } from 'react'
import Smartlook from 'smartlook-client'
function MyApp({ Component, pageProps }) {
useEffect(() => {
Smartlook.init('0fd3b003ee5e7fc2d0ffae19b6ff35f190f21117')
}, [])
return <Component {...pageProps} />}
}
export default MyApp