Making WordPress.org

Changeset 8606


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

Login: Add GTM code to more login pages.

See #4371.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
2 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/**
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php

    r8278 r8606  
    1313<title><?php _e( 'WordPress.org Login', 'wporg' ); ?></title>
    1414<meta name="viewport" content="width=device-width, initial-scale=1">
    15 <link rel="dns-prefetch" href="//www.googletagmanager.com">
    16 
    17 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    18 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    19 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    20 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    21 })(window,document,'script','dataLayer','GTM-P24PF4B');</script>
    22 
    2315<?php wp_head(); ?>
    2416</head>
Note: See TracChangeset for help on using the changeset viewer.