• Home
  • Blog Categories
    • AdWords
    • Facebook
    • Amazon
    • eCommerce
    • Lead Generation
    • Google Exams
  • Blog Archive

PPC Wins

Tips & strategies for getting the most from your PPC campaigns

Google Analytics Virtual Pageviews – How to Setup

June 25, 2016 By John King Leave a Comment

Google Analytics virtual pageviews have a whole bunch of uses.

Recently I was setting them up for this blog, in order to track some outbound links, and thought it was worth sharing how to do this.

The main uses I can think of are:

  • To track outbound links
  • To track clicks on a specific link on a page (rather than just tracking visits to the page, which could come from multiple sources)
  • To track sending a message on a form

Using the most recent Google Analytics script (analytics.js), the syntax format for virtual page views is:

More info on the GA site – https://developers.google.com/analytics/devguides/collection/analyticsjs/pages#pageview_fields

How would this look if we wanted to make a specific URL trackable?

<a href="www.example.com" onclick="ga('send', 'pageview', 'vpv/example-url');" />

Notice how we have specifically added an onclick event, and passed it the name of a page view to fire.

Because virtual pageviews are not ‘real’ page views, it helps to have a way to filter them from your metrics. In the example above I’ve used the prefix /vpv/, which we can easily filter for in analytics if we want to. That way we’ll know everything with /vpv/ is a virtual pageview.

What’s really nice about this, is that you can quickly check if they’re working, but going to the Real Time part of Google Analytics:

Screen Shot 2016-06-25 at 09.55.14

 

Filed Under: Google Analytics

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts

First Time Here?

Hey and welcome to the site.

PPC Wins is a site dedicated to sharing with you useful tips and advice for getting the most out of PPC campaigns.

If there is a topic you would like to see covered please get in contact.

Categories

  • AdWords
  • Amazon
  • eCommerce
  • Facebook
  • Google Analytics
  • Google Exams
  • Lead Generation
  • Uncategorized
google-adwords-certified-partner2
BingAds_Accredited_Badge (1)

Copyright © 2022 ppcwins.com