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.
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.
The display name of the author of the currently visited page/post. The type of the value will be a simple String.
The internal ID of the author of the currently visited page/post. The value will be an Integer number.
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)
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.
It is almost the same as pagePostType, but with a prefix to differentiate certain page types:
- tax- (for custom taxonomy pages)