Send pageviews programmatically

Hello,

I have a similar issue to the following task:

I am setting up GA 4 and trying to setup a pageviews event to fire upon every navigation. I have turned off the default Pageview event from the Google Analytics 4 action and disabled the Single Page Application support from zaraz settings.

I am firing the pageview event using zaraz.track in the following way:

zaraz.track('page_view', {
    page_location: location,
    page_title: title,
});

The event fires successfully upon every navigation. The problem is the location and title data are not passed correctly in the event’s data.
Is my eventProperties’ object structure wrong? page_location and page_title are not the correct keys to target in order to pass the appropriate data?

Thanks in advance!

Just figured it out. Works fine. Thanks.

See FAQ · Cloudflare Zaraz docs

1 Like