Analytics won't track pageviews

Hi all, I am working on a new website with Frontity -> remarketingo.com (is still under construction), and I came across a problem.

I have successfully installed GTM package and added Google Analytics tag inside GTM.

When I send test traffic or visiting from another device, I can see in Real Time tab all that traffic.

The problem comes when I navigate through the website, Google Analytics “sees” me on the same page where I landed, but it doesn’t track any other page that I visit.

Any idea on how can I fix that?

Thank you very much.

Any idea?

Hi @alin

Are you changing the head tags for each page with the <Head> component? (more info)

If the <title> tag is the same for all pages I think GA will register each separate page as though it were the same page. (disclaimer: I’m no expert on GA :man_shrugging: :grinning:)

@mburridge I use yoast package to import all meta data tags so yes, I think each page has it’s own title.

Hi @alin

I just took a look at the site you linked to, and yes, the title is changing for each page (though the home page and blog page have the same title).

According to this page "actions.analytics.pageview is automatically launched every time link changes" and “This action is is not meant to be called directly”.

@David do you have any suggestions here?

@alin It looks like some configuration may be necessary, according to this page “If @frontity/google-tag-manager-analytics is configured and enabled for pageviews in state.analytics.pageviews , every time a link changes (or every time action.router.set(link) is launched) a tracking for that page will be sent to Google Tag Manager.”

Hey @alin!

It could probably be related to the way Google Analytics is configured in your GTM container.

Instead of triggering pageviews using the events provided by GTM, you would have to use a custom event called pageview, which is added to the Data Layer by the @frontity/google-tag-manager-analytics package. The format of this event is explained here: Google Tag Manager package

@mburridge, I’m afraid our documentation doesn’t explain this very well. Should I open an issue?

Yes, please do.

Done: https://github.com/frontity/docs/issues/262