Making WordPress.org

Changeset 9183


Ignore:
Timestamp:
10/15/2019 07:52:31 AM (6 years ago)
Author:
dd32
Message:

WordPress.org/Gutenberg: Include the Google Tag Manager code.

Fixe #4626.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/front-page.php

    r7564 r9183  
    99
    1010    <body <?php body_class( 'folded' ); ?>>
     11        <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P24PF4B" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    1112        <div class="gutenberg">
    1213            <div id="editor" class="gutenberg__editor"></div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php

    r9039 r9183  
    10291029
    10301030add_filter( 'handbook_display_toc', '__return_false' );
     1031
     1032/**
     1033 * Output the GoogleTagManager <head> tags.
     1034 */
     1035function wporg_gutenberg_gtm() {
     1036    ?>
     1037
     1038    <link rel="dns-prefetch" href="//www.googletagmanager.com">
     1039
     1040    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
     1041    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
     1042    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
     1043    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
     1044    })(window,document,'script','dataLayer','GTM-P24PF4B');</script>
     1045
     1046    <?php
     1047}
     1048add_action( 'wp_head', 'wporg_gutenberg_gtm' );
Note: See TracChangeset for help on using the changeset viewer.