A virtual page view tag helps you track elements on your website by creating a ‘pretend’ page. This page shows up in reports with a URL and title, just like a real one.
To set up the virtual page view tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name your tag and select the following type: Virtual page view.
- Add the URL and document title 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 only fire 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’ve turned on the Do-Not-Track feature in their browsers or who’ve opted out of tracking using our opt-out form.
- In Flight dates, set the date and time when the tag will fire.
- In Tag triggers, click Add a trigger or Choose existing trigger to set up a trigger for your tag.
Tip: For this tag, we often use a click trigger that fires it when a visitor clicks a specific click ID.
- Click Save.
- Test your tag in debug mode.
- When you’re happy with how the tag works, click Publish.
- Done! After a while, data will be collected and you’ll be able to see virtual page views in your reports.