PHP code example of humanmade / hm-gtm
1. Go to this page and download the library: Download humanmade/hm-gtm library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
humanmade / hm-gtm example snippets
wp_body_open();
add_filter( 'hm_gtm_data_layer', function( $data ) {
$data['my_var'] = 'hello';
return $data;
} );
register_block_type( 'my-plugin/my-block', [
'supports' => [
'gtm' => false,
],
) );
add_filter( 'hm_gtm_enable_event_tracking', '__return_false' );