• Resolved jrgalia

    (@jrgalia)


    How can we add this code if we are using the plugin.

    gtag('config', 'some values');

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Michelle D.

    (@devmich)

    Hi @jrgalia,

    I’m so sorry about the wait here.

    To add some custom code you can use the following filter:

    add_filter( 'monsterinsights_frontend_tracking_options_gtag_end', function ( $options, $type ){
    	if ( 'ua' === $type ) {
    		$options['test_key_ua'] = 'test_value_ua';
    	}
    
    	if ( 'v4' === $type ) {
    		$options['test_key_v4'] = 'test_value_v4';
    	}
    
    	return $options;
    }, 20, 2 );

    And as an example, this will generate (for V4):

    __gtagTracker( 'config', 'G-XXXXXXXX', {"test_key_v4":"test_value_v4"} );

    If you need further help with this, please feel free to reach out to us https://www.monsterinsights.com/lite-support/.

    Thanks so much!

Viewing 1 replies (of 1 total)
  • The topic ‘Additional Custom gtag config’ is closed to new replies.