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 site user and visitor data

WordPress site user and visitor data

Use the following data layer variables to access data about the logged in user on your WordPress site and about the anonymous visitor. This list includes lots of data that is considered as personal data. Please make sure that you obtain proper consent from the visitor in order to access and process most of this data. It is your responsibility to comply with data protection regulations world wide (including but not limited to GDPR or CCPA). GTM4WP is only giving you the opportunity to access the data. Processing with user consent has to be setup within your Google Tag Manager container.

  • visitorId
  • visitorLoginState
  • visitorType
  • visitorDoNotTrack
  • visitorEmail and visitorEmailHash
  • visitorRegistrationDate
  • visitorUsername
  • visitorIP

visitorId

This variable will include the internal ID of the logged in user. The primary use of this variable is to setup User-ID tracking in tools where this data collection is available in order to match user sessions across devices. This value is not included in the Data Layer if there is no logged in user even if you enabled the feature on the settings page of this plugin.

visitorLoginState

This is a very simple Data Layer variable: the value logged-in means someone is logged in to your site regardless of the user level. The value logged-out means that an anonymous user is on your site.

visitorType

You can use this variable to identify the user level (aka. user role) of the logged in user.

If there is no logged in user on your site, the value visitor-logged-out will indicate that state. If a WordPress user is logged in, the name of the role of the logged in user will be included. For admin this will be administrator, for lower level users this can be something else like editor.

visitorDoNotTrack

This option is deprecated. Please do not use it on new sites and consider replacing with other methods as this browser feature itself is deprecated and will be removed from browsers soon.

This data layer variable will give you a 0 or 1 depending on the visitor (regardless of being logged in or not) set the Do Not Track option in the browser. Since this browser feature is deprecated, you should not rely only on this data to manage consent based tag firing.

visitorEmail and visitorEmailHash

This data layer variable includes the email address of the logged in user on your site. It can be used with tags where this data can be added to tracking (in most cases conversion tracking) to improve tracking accuracy. The difference between the regular and visitorEmailHash variable is that the hashed variable includes the email address using SHA-256 hashing which is usually required to improve privacy measures.

visitorRegistrationDate

This data layer variable includes the date when the logged in user has registered on your website. It is a Unix timestamp.

visitorUsername

Use this data layer variable to access the username of the logged in user on your website.

visitorIP

This data layer variable will include the IP address of the visitor on your site for both logged in and anonymous users. GTM4WP tries to properly identify this data by also examining the following HTTP headers for users behind a proxy server or other network device:

  • HTTP_X_FORWARDED_FOR: if includes a list of IP addresses, the first valid IP address will be returned
  • HTTP_CLIENT_IP
  • HTTP_X_FORWARDED
  • HTTP_X_CLUSTER_CLIENT_IP
  • HTTP_FORWARDED_FOR
  • HTTP_FORWARDED
  • REMOTE_ADDR

© 2025 Google Tag Manager for WordPress - Privacy policy

  • WordPress.org plugin page
  • Plugin support
  • Plugin reviews
Cookies are not evil
This website may use cookies to remember your log-in details, to optimize site functionality for your use, and deliver marketing based on your interests.

This does not include collecting any personal data of you. In any case we need to process any of your personal data, we will ask for your specific consent later for sure.

Accepting this message only means that we will be able to analyze site content performance using larger buckets of users and to deliver tailored messages to those user buckets. We will be not able to analyze your activity alone especially not in a way where your name or any personal data of you is attached to this analysis.

Accept Settings
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-*1 yearUsed by the cookie consent manager of this website to remember your choice of cookie usage.
gtm4wp_last_weatherstatusend of user sessionUsed by a plugin of this WordPress website to dump debug related non-personal data about the weather data identified during your site visit.
Advertising
Tracking codes that could be used to tailor our messages based on your interests. This does not mean that we will be able to track your activities alone especially not in a way that would allow us to connect your name or other personal data to your website activities.
Statistical
Tracking of website usage without using any feature that would involve personal data processing either by us or by our tracking vendor. This includes IP address anonymization and disabling features related to interest based advertising.
Save & Accept
  • 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