Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Tracking Virtual Page Views

How-to article.

With Hotjar, you can use Funnels to understand how your visitors flow through a particular set of pages. For example, you may want to analyse how many visitors move from your homepage to your sign-up page and then to your confirmation page. To define a Funnel in Hotjar, you simply need to specify the URLs that make up that funnel. Using the earlier example, you would set up something similar to:

  • www.your-domain.com/
  • www.your-domain.com/sign-up/
  • www.your-domain.com/confirmation/

Occasionally, you may want to track steps that do not have a unique URL. For instance, if you were trying to track how many users signed-up to your site but the sign-up form opened up as an overlay, it would not have a unique URL you can track. Instead, you can use something called Virtual Page Views.

Virtual Page Views allows you to track a URL even if your visitors did not actually have that URL loaded in their browser. To track a virtual page view, you will need to add a simple line of JavaScript code and then add the same name to the Funnel step with a "Contain" page targeting rule:

JavaScript Code

hj('vpv', '/some/path');

Funnel Step

IMPORTANT

For this line of code to work, it must be added to a page which includes the Hotjar Tracking Code. If you wish to trigger the Virtual Page View as soon as a page loads, please make sure the Hotjar Tracking Code is included before the virtual page view call.

Usage Example.

Say you have a JavaScript function which opens a sign-up form overlay:

function open_signup_overlay() {
  
    // Code to open your overlay
 
}

You can easily start tracking a Virtual Page View by adding the JavaScript snippet to this function:

function open_signup_overlay() {
 
    // Code to open your overlay
 
    // Hotjar Virtual Page View trigger.
    hj('vpv', '/sign-up/');
 
}

When creating your funnel in Hotjar, simply enter a "Contains" rule for /sign-up/ to start tracking the virtual page view as a step in your funnel.

Keywords: pop-ups, lightbox, popup, AJAX, one page checkout

Tracking Virtual Page Views

How-to article.