Skip to content
Facebook Twitter Github RSS
Google Tag Manager for WordPress
  • Home
  • FeaturesExpand
    • Basic features of GTM4WP

      You can use many post or page attribute in you Google Tag Manager setup even for custom post types and taxonomies.

      Basic data

      Page / post attributes

      Site search

      User data

      Multisite data

      3rd party data

      Browser attributes

      Device attributes

      Operating system attributes

      Weather conditions

  • SetupExpand
    • Setup advanced GTM4WP features

      Integrate your measurement with WooCommerce, setup Google Analytics 4, Google Ads remarketing or conversion tracking maximizing capabilities.

      WooCommerce related

      Google Analytics 4

      Google Ads – Dynamic Remarketing

      Google Ads – Conversion tracking

      Google Ads – Enhanced Conversions

      Other setup articles

      Exclude WordPress admins

      Embedded media players

  • DevelopersExpand
    • Information for developers and WP managers

      There are several tools in GTM4WP to support your special needs and to adjust plugin behavior to your website or WooCommerce shop.

      Do you want to contribute with a bugfix or a new feature? Visit the GTM4WP’s GitHub page!

      For Developers

      Actions and filters

      WP themes + Proper ecommerce tracking

      For WP managers

      Setup GTM Environments

      Hard code GTM parameters

  • Blog
  • GDPR
Download
Google Tag Manager for WordPress
Home / Use basic WordPress data in Google Tag Manager / WordPress page/post attributes in Google Tag Manager

WordPress page/post attributes in Google Tag Manager

Use the following data layer variables to access data about the currently shown content in single and archive pages and posts supporting custom post types as well. With the following data layer variables you can access page and post attributes in Google Tag Manager.

  • pageTitle
  • pageAttributes
  • pageCategory
  • pagePostAuthor
  • pagePostAuthorID
  • pagePostDate, pagePostDateYear, pagePostDateMonth, pagePostDateDay
  • pagePostType
  • pagePostType2

pageTitle

The title of the page, usually shown on the tab of the browser. Note, that this value will be generated on the server during page generation using the wp_title() function. This is usually the value of the page title in the browser tab but in some cases this can differ from what you see as tab title.

pageAttributes

A JavaScript Array with the tags associated with the currently visited page/post.

pageCategory

A JavaScript Array with the categories associated with the currently visited page/post.

pagePostAuthor

The display name of the author of the currently visited page/post. The type of the value will be a simple String.

pagePostAuthorID

The internal ID of the author of the currently visited page/post. The value will be an Integer number.

pagePostDate, pagePostDateYear, pagePostDateMonth, pagePostDateDay

The pagePostDate variable will include the date of the currently visited page/post in the format set in the settings section of WordPress. The remaining 3 variables will only include a specific part of the same date as a number with a leading 0 for single numbers (04=April for example)

pagePostType

The value returned by the get_post_type() WordPress function. Can be page or post or the name of any custom post type on your site. The special value frontpage will be set when the user is on the frontpage of your website and bloghome if the user is on the main blog page set in the settings section of WordPress.

pagePostType2

It is almost the same as pagePostType, but with a prefix to differentiate certain page types:

  • single-
  • category-
  • tag-
  • tax- (for custom taxonomy pages)
  • author-
  • year-
  • month-
  • day-
  • date-
  • time-

© 2026 Google Tag Manager for WordPress - Privacy policy

  • WordPress.org plugin page
  • Plugin support
  • Plugin reviews
  • Home
  • Features
    • Basic features of GTM4WP

      You can use many post or page attribute in you Google Tag Manager setup even for custom post types and taxonomies.

      Basic data

      Page / post attributes

      Site search

      User data

      Multisite data

      3rd party data

      Browser attributes

      Device attributes

      Operating system attributes

      Weather conditions

  • Setup
    • Setup advanced GTM4WP features

      Integrate your measurement with WooCommerce, setup Google Analytics 4, Google Ads remarketing or conversion tracking maximizing capabilities.

      WooCommerce related

      Google Analytics 4

      Google Ads – Dynamic Remarketing

      Google Ads – Conversion tracking

      Google Ads – Enhanced Conversions

      Other setup articles

      Exclude WordPress admins

      Embedded media players

  • Developers
    • Information for developers and WP managers

      There are several tools in GTM4WP to support your special needs and to adjust plugin behavior to your website or WooCommerce shop.

      Do you want to contribute with a bugfix or a new feature? Visit the GTM4WP’s GitHub page!

      For Developers

      Actions and filters

      WP themes + Proper ecommerce tracking

      For WP managers

      Setup GTM Environments

      Hard code GTM parameters

  • Blog
  • GDPR
Search