Error with GTM4WP_WPFILTER_COMPILE_DATALAYER
-
I am adding custom fields to the data layer through by adding this code to functions.php
add_filter( GTM4WP_WPFILTER_COMPILE_DATALAYER, “custom_dataLayer”);
function custom_dataLayer( $dataLayer ) {
$dataLayer[“price”] = get_field( ‘product_price’, false, false );
$dataLayer[“name”] = get_field( ‘product_name’, false, false );return $dataLayer;
}This worked fine but recently I am getting this error message:
constant GTM4WP_WPFILTER_COMPILE_DATALAYER – assumed ‘GTM4WP_WPFILTER_COMPILE_DATALAYER’ (this will throw an Error in a future version of PHP) in functions.php on line 62
Any idea why and how to fix it?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Error with GTM4WP_WPFILTER_COMPILE_DATALAYER’ is closed to new replies.