Track pageview on js application

Hi there, I’m switching a js application (I think it is in vue.js) from Universal Analytics to Piwik Pro.

In Universal Analytics I tracked PageViews triggering the Universal Analytics Tag in Google Tag Manager using a custom event read from the Data Layer; I also added Page and Title values with variables from the DataLayer.

What is the right approach with Piwik Pro?

• I was able to create the trigger
• I didn’t found ways to add Page and Title to the Piwik Pro Tag in Tag Manager

Do I have to use Virtual Page View Tag?
Do I have to delete the Piwik Pro Tag?

Thanks for your help

Francesco

Hi,

a Virtual Page view seems to be the right solution. If you need the regular pageview or not depends on how your app handles the first load. Is there a custom event already when someone enters the site and loads the first view or does that event occur with the first change of location (when a user navigates the site)?

I would suggest to keep the regular pageview, visit the site and either look at the dataLayer in the console, check the Tag Manager preview and / or look at the Tracker Debugger. If you see your first page view twice, you can pause the regular tag and see what happens when you repeat that test.

best,
Markus

Piwik PRO tag is always needed as it loads the js library. In case of duplicates, you can disable tracking page views by the Piwik PRO tag directly.

I can only add that everything should work as the thing you described is a pretty standard setup giving full control over when the page view is triggered.

Hi There,

Actually I’m seeing 3x PageViews events ad I’m using to see in Analytics.

This is my setup:
• inject piwik container using GTM on All Pages Trigger
• Piwik Pro Tag is set to ‘Track Page View manually’
• I’ve added a Virtual Page View Tag on a custom event (nuxtRoute)

With the Piwik Pro debugger I see:
• 2 pageviews on Home Page (Piwik Pro + 2x Virtual Page View)
• 1 pageview when browsing virtual pages
• 2 pageviews every time there a ‘real’ load of another page (Piwik Pro + 2x Virtual Page View)

Can’t understand why the PageView gets triggered two times

Help! :slight_smile:

Francesco