gtm4wp_filter_visitor_keys

The Google Tag Manager for WordPress gtm4wp filter visitor keys function.

Description

gtm4wp_filter_visitor_keys( $dataLayer ); 

Parameters (1)

0. $datalayer
The datalayer.

Usage

  1. if ( !function_exists( 'gtm4wp_filter_visitor_keys' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-tag-manager-for-wordpress/public/frontend.php'; 
  3.  
  4. // The datalayer. 
  5. $datalayer = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gtm4wp_filter_visitor_keys($datalayer); 
  9.  

Defined (1)

The function is defined in the following location(s).

/public/frontend.php  
  1. function gtm4wp_filter_visitor_keys( $dataLayer ) { 
  2. foreach( $dataLayer as $dl_key => $dl_value ) { 
  3. if ( strpos( $dl_key, "visitor" ) !== false ) { 
  4. unset( $dataLayer[ $dl_key ] ); 
  5.  
  6. return $dataLayer;