The Virtual page view tag lets you create a virtual page to track elements on your website. The virtual page is not real, but it appears in reports as a real page — it has the page URL and the page title. If you type the virtual page URL in the browser, you won’t find the page. It only exists to help you analyze something.
To create and set up the virtual page view tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name the tag and select the following type: Virtual page view.
Document titlethat you want to see in reports for this virtual page view.
Note: You can track a previously created custom dimension by picking the index number of the dimension and providing its value. For more, read this article.
- In Advanced tag settings, choose Consent type. Set it up if you use a consent form on your site. This tag will fire only for visitors who accept the selected consent type.
- Respect opt-out and DNT is turned on by default. Leave it as is, if you want to respect visitors who set Do-Not-Track in their browsers, or visitors who opt out of tracking using our opt-out form.
- Enable document.write is turned off by default. Toggle this option, if your tag needs
- In Flight dates, set the date and time when the tag is fired.
- In Tag triggers, click Add a trigger or Choose existing trigger to set up a trigger for your tag.
- Adjust trigger conditions.
Tip: We usually use the click trigger that fires a tag when a visitor clicks a particular click ID.
- When you’re done, click OK for the trigger
- Click Save for the tag.
- Test your tag in debug mode.
- When you’re happy how the tag works, click Publish.
- After some time, data will be collected and you will be able to see virtual page views in your reports. For example, in Menu > Analytics > Pages.