• Resolved fernandorigotti

    (@fernandorigotti)


    Hi there. I need to add a second GA tracking code on web-story posts.

    I tried to use the code below but it isn’t working.

    add_action(
    	'web_stories_print_analytics',
    	static function() {
    		echo '<amp-analytics type="googleanalytics" id="analytics1"><script type="application/json">{"vars":{"account":"UA-XXXXXX"},"triggers":{"trackPageview":{"on":"visible","request":"pageview","extraUrlParams":{"cd1":"<?php echo get_the_date("M-Y"); ?>"}}}}</script></amp-analytics>';
    	}
    );
    add_action('wp-footer', 'web_stories_print_analytics');

    Anyone can help me? Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Second GA code’ is closed to new replies.