Set up VIEW events

Version: 0.5
Note

If you're using a Content SDK or JSS app, you don't need to complete with walkthrough because those apps automatically capture VIEW events, with no coding required.

You can use the Cloud SDK events package to capture VIEW events. The VIEW event tracks when the site visitor views a webpage in your web app. Because it is an essential event to track, it's important that you send VIEW events from all webpages where you want to track site visitor behavior. In this topic, you'll start capturing events in a Next.js app that uses the App Router.

Before you begin
  • In your code editor, open the root folder of your web app.

  • Install and initialize the Cloud SDK and the events package.

Setting up VIEW event capturing will run the pageView function every time a webpage loads in your web app.

Do you have some feedback for us?

If you have suggestions for improving this article,