Making WordPress.org


Ignore:
Timestamp:
04/08/2019 08:14:09 AM (6 years ago)
Author:
dd32
Message:

Login: Add GTM code to more login pages.

See #4371.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r7265 r8606  
    8383}
    8484add_action( 'init', 'wporg_login_register_scripts' );
     85
     86function wporg_login_gtm() {
     87    ?>
     88    <link rel="dns-prefetch" href="//www.googletagmanager.com">
     89
     90    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
     91    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
     92    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
     93    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
     94    })(window,document,'script','dataLayer','GTM-P24PF4B');</script>
     95    <?php
     96}
     97add_action( 'wp_head', 'wporg_login_gtm' );
     98add_action( 'login_head', 'wporg_login_gtm' );
    8599
    86100/**
Note: See TracChangeset for help on using the changeset viewer.