Skip to content

Instantly share code, notes, and snippets.

@alewolf
Last active August 3, 2021 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alewolf/73ed95ad1bdc69c8ba558ab8d9f9515b to your computer and use it in GitHub Desktop.
Save alewolf/73ed95ad1bdc69c8ba558ab8d9f9515b to your computer and use it in GitHub Desktop.
add custom dimensions to Google Universal Analytics in woopt WooCommerce Pixel Manager
<?
add_filter('wooptpm_ga_ua_parameters', function ($analytics_parameters, $analytics_id){
$analytics_parameters['custom_map'] = [
'dimension1' => 'ecomm_prodid',
'dimension2' => 'ecomm_pagetype',
'dimension3' => 'ecomm_totalvalue',
];
return $analytics_parameters;
}, 10,2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment