WordPress.org

Making WordPress.org


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

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

Fixe #4626.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.