Fair course pricing, all year round. Learn about our approach

GTM Page Path vs. Page URL vs. Page Hostname

Page path vs page url vs page hostname

Google Tag Manager (GTM) includes a number of built-in variables you can use to identify the pages people are viewing on your website. These page-based variables can be especially helpful when configuring triggers to fire your tags. Here’s a cheat sheet for the page path, page URL, and page hostname variables in GTM.

Here are the values that the page-based variables will provide if we’re viewing this page:

https://www.example.com/page?query=true

VariableOutput
Page Path/page
Page URLhttps://www.example.com/page?query=true
Page Hostnamewww.example.com

So that’s the difference between ‘Page Path’, ‘Page URL’, and ‘Page Hostname’ in Google Tag Manager. And here’s a brief description of each variable:

What is 'Page URL' in GTM?

Provides the full URL of the page someone is viewing.

For example: https://www.example.com/page?query=true

What is 'Page Hostname' in GTM?

Provides the domain name of the page someone is viewing.

For example: www.example.com

What is 'Page Path' in GTM?

Provides the page someone is viewing.

For example: /page

Important: Page path does not include query parameters (e.g. ?query=true) or fragments (e.g. #anchor-link).

What is 'Referrer' in GTM?

Provides the full URL of the page someone viewed before the current page.

For example: https://www.example.com/about


For more important terms you’ll encounter, take a moment to check out our Google Tag Manager Glossary.