Filter authors tracking custom dimension with Google Analytics

Since SEOPress 2.6

function sp_gtag_cd_author_cf($html) {
return "'dimension1': 'cd_author',";
}
add_filter('seopress_gtag_cd_author_cf', 'sp_gtag_cd_author_cf');

function sp_gtag_cd_author_ev($html) { 
return "gtag('event', '".__('Authors','wp-seopress')."', {'cd_author': '".get_the_author()."'});"; 
} 
add_filter('seopress_gtag_cd_author_ev', 'sp_gtag_cd_author_ev');

Last modified: April 1, 2018