# Track pageview on js application

**URL:** <https://community.piwik.pro/t/track-pageview-on-js-application/864>\
**Category:** Data collection and tags\
**Created:** [August 1, 2022, 6:41pm UTC](https://community.piwik.pro/t/track-pageview-on-js-application/864 "2022-08-01T18:41:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francesco\_Pensabene](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/francesco_pensabene/32/543_2.png) [@Francesco\_Pensabene](https://community.piwik.pro/u/Francesco_Pensabene)\
**Post date:** [August 1, 2022, 6:41pm UTC](https://community.piwik.pro/t/track-pageview-on-js-application/864/1 "2022-08-01T18:41:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbaersch](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/mbaersch/32/35_2.png) [@mbaersch](https://community.piwik.pro/u/mbaersch)\
**Post date:** [August 1, 2022, 6:54pm UTC](https://community.piwik.pro/t/track-pageview-on-js-application/864/2 "2022-08-01T18:54:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [August 1, 2022, 9:28pm UTC](https://community.piwik.pro/t/track-pageview-on-js-application/864/3 "2022-08-01T21:28:39Z")

</div>

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.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/1X/0b713e921299500e498e67ac5b530f7284a2a108.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![Francesco\_Pensabene](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/francesco_pensabene/32/543_2.png) [@Francesco\_Pensabene](https://community.piwik.pro/u/Francesco_Pensabene)\
**Post date:** [August 4, 2022, 9:27am UTC](https://community.piwik.pro/t/track-pageview-on-js-application/864/4 "2022-08-04T09:27:51Z")

</div>

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! 🙂

Francesco
