Created
January 20, 2023 12:34
-
-
Save maheshwaghmare/ed1bf11b453887543b203dc9b279aae9 to your computer and use it in GitHub Desktop.
Add/Modify Google tag manager variables for Rank Math SEO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'prefix_analytics_gtag_config' ) ) : | |
/** | |
* Add/Modify Google tag manager variables | |
* | |
* @param array $args Google analytics arguments | |
*/ | |
function prefix_analytics_gtag_config( $args = [] ) { | |
$args[] = 'cookie_flags:"max-age=7200;secure;samesite=none"'; | |
return $args; | |
} | |
add_filter( 'rank_math/analytics/gtag_config', 'prefix_analytics_gtag_config' ); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment