Google Tag Manager Custom Template – Yandex Metrica

It’s been a while since my last post ( Shame on me!) , but the new Custom Templates feature has been a great addition to Google Tag Manager the last week.

If you don’t know what the Custom Templates are, please do yourself a favor and read Simo Ahava’s great guide on them.

I’ve been playing the last days with this new feature, trying to build a more complex template, so I decided to try to implement a full Yandex Metrica Custom Template for Google Tag Manager.

What’s supported:

Method ( track types )

  • Init
  • Outbound links ( Fields: URL )
  • File Downloads ( Fields: URL , Referrer )
  • Reach Goals ( Fields: Target, Order Price, Currency )
  • Hit ( Fields: URL, Referrer, Title )
  • User Id ( Fields: User Id )
  • Session Pameters ( Fields : Parameters Map )
  • User Parameters ( Fields : Parameters Map )
  • Not Bounces

Tracking features supported on the tracker:

  • Enabling/Disabling default Data Sending ( default pageview, useful for SPA Sites )
  • Enabling Hash Tracking
  • Disabling sending pages to Yandex Index
  • Loading the Script library from the alternative CDN
  • Enabling/Disabling Accurate Track Bounce tracking
  • Enabling/Disabling Click Maps tracking
  • Enabling/Disabling Track Links ( including extensions personalization)
  • Enabling/Disabling Webvisor
  • Enabling Disabling the Debugging Cookie
  • Ecommerce Tracking ( data layer variable name can be personalized )

I’ve included some advanced features ( I’m new to Yandex Metrica, so I had no time to properly test them yet )

  • Debug Mode can be enabled from Init Tag without the need of setting up a QueryString parameter

Upcoming features

  • Callbacks support
  • Code improvements/comments

You can get the template from the following URL: https://github.com/thyngster/gtmtemplates/tree/master/Yandex%20Metrica

ChangeLog 14 June 2019

  • Fixed Ecommerce Setup . It was not being initilized.
  • Minor UI Reorganization
  • Added Session Parameters Tracking
  • Added User Parameters Tracking
  • Added userID Tracking
  • Added not-Bounce Tracking
  • Fixed Debug being reset on after init methods

Screenshots

Waiting for your feedback and request 🙂

Comments

4 responses to “Google Tag Manager Custom Template – Yandex Metrica”

  1. paco Avatar
    paco

    Gracias por el aporte, pero da error al importar el archivo en tag templates.

    1. David Vallejo Avatar

      Hol a Paco, he hecho pruebas durante varios días y a mi me lo importa correctamente en todos lados, algo debes estar haciendo raro.

      Desconozco como te descargas la plantilla, pero la cosa sería ir a esta url: https://raw.githubusercontent.com/thyngster/gtmtemplates/master/Yandex%20Metrica/gtm_yandex_metrica_custom_template.tpl , darle a Control + S ( o boton derecho salvar como ) y luego importar el archivo.

      Ya me dirás si te funciona…

  2. Erick Avatar
    Erick

    Hola, gracias por el aporte, tengo una duda, donde o como puedo hacer el id de seguimiento? tendrás alguna documentación que pueda segui

  3. Fanat Yandex Avatar
    Fanat Yandex

    Where is the instruction in Russian?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.