Coder Social home page Coder Social logo

analyticsftw / gtmforwordpress Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 2.0 5 KB

A Wordpress theme function to populate a Google Tag Manager data layer with page and post data (author, category, year, comments, etc.)

License: MIT License

PHP 100.00%

gtmforwordpress's Introduction

gtmforwordpress

A Wordpress theme function by Julien Coquet to populate a Google Tag Manager data layer with page and post data (author, category, year, comments, etc.)

gtmforwordpress's People

Contributors

analyticsftw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gtmforwordpress's Issues

listing some errors after WP4.6

I'm getting this in DEBUG:

`Warning: trim() expects parameter 1 to be string, array given in
/var/www/htdocs/wp-content/themes/GTMTest/functions.php on line 43

Notice: Undefined variable: gtm_tags in
/var/www/htdocs/wp-content/themes/GTMTest/functions.php on line 46

Warning: join(): Invalid arguments passed in /var/www/htdocs/wp-content/themes/GTMTest/functions.php on line 52`

Thank you

get_the_author() not working

thank you for the code, get_the_author() doesnt seem to work for me it just generates blank. It could be a problem with my instalation because get_the_author_meta('user_email') also doesn't work. Any suggestions?

Snippet:

<script type='text/javascript'>
  // URL JavaScript toolbox, saves times creating variables
  var _d = document;
  var _dl = _d.location;
  var _dlp = _dl.pathname;
  var _dls = _dl.search;
  var _dr = _d.referrer;
  var dataLayer = [{
	'isLoggedIn': 'Yes',

    'author': '',
    'date': '2016-11-18',
    'postType': 'post',
    'postCategory': 'Current',
    'postCategories': '',
    'postTags': 'e-voting',
    'email': '',
'terminator': 'I\'ll be back' // Always terminate your arrays!
  }];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.