How To Track Internal Links as Goals in Google Analytics

Josh Chambers, Former Viget

Article Category: #Strategy

Posted on

I recently wrote a post about how to track internal links in Google Analytics using the trackPageview method, and I promised I would follow up with how to use those virtual pageviews to set goals.

Thanks to Michelle for her comment and lighting the fire to write the follow-up post. = )

First, why would you ever want to use an internal link/virtual pageview in a goal funnel?

Let's say you own a guitar shop, and your conversion funnel is: "Guitars" --> "Guitar Details" --> "Purchase" --> "Confirmation."

If any/all of those steps meet any of the following criteria, you need to use internal link tracking:

  • Your users are interacting with Flash/Ajax/lightboxes etc. and the URL doesn't change from one step to another.
  • Once someone makes a purchase, there is no unique confirmation page. For example, if when I buy my guitar, the purchase page takes me to a dynamic page based on what I purchase. Or, if after I buy my guitar and I get redirected back to the homepage, the homepage URL isn't a goal so that shouldn't be counted as a conversion.

So, how to do it:

You can see a trend -- when URLs aren't unique, or when they don't change on clicks, you may need to create virtual pageviews. Using the example above, let's say this is the URL path:

  • Guitars: /guitars.html
  • Guitar Details: /guitars.html (A lightbox appears with the guitar, and a "purchase now" button.)
  • Purchase: /purchase/guitar/fender-jaguar.html
  • Purchase Confirmation: /purchase/confirmation/fender-jaguar.html

What to do? Well, on the guitar details lightbox, you should include the trackPageview script in the "purchase" button, and call that virtual pageview "internal-links/guitar-purchase/fender-jaguar." So now you've got a "fake" or "virtual" pageview in your analytics.

Next, build the funnel:

  • Use "Head Match" and your funnel should look like this:
  • Step 1: /guitars.html
  • Step 2: /internal-links/guitar-purchase
  • Step 3: /purchase/guitar
  • Goal URL: /purchase/confirmation.html

Breaking the funnel down:

  • Step one pulls in the generic "Guitars" page.
  • Step two pulls in all "Purchase Now" buttons -- not just the Fender Jaguar; you can use "Top Content" to identify which guitar generates the most "purchase now" clicks. 
  • Step three pulls in all "Purchase" pages -- again, not just the Fender Jaguar purchase page.
  • The Goal URL pulls in all confirmed purchases -- once more, not just the Fender Jaguar confirmation page.

That's it! Once you've sent the virtual pageview to Google Analytics, GA treats it like any other page, and you plug it straight into your goals. If you're using regular expressions for your goal match type when using the internal links above, you would use this forumla: ^/internal-links/guitar-purchase.*

You're good to go!

Be sure to check out my other GA internal link tracking post for some hints and drawbacks when using internal links.


Related Articles