analyticsftw / gtmforwordpress

A Wordpress theme function to populate a Google Tag Manager data layer with page and post data (author, category, year, comments, etc.)
MIT License
14 stars 2 forks source link

listing some errors after WP4.6 #1

Closed LockeAG closed 7 years ago

LockeAG commented 8 years ago

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

analyticsftw commented 8 years ago

Hi,

I can't comment on the exact line numbers of course but this is not related to 4.6 (I have other 4.6 blogs using this exact code and they're fine) but rather to a lack of error management in this script.

The first error you are getting implies you are not getting post tags properly; do you have tags assigned to the post?

analyticsftw commented 7 years ago

Hi, I ran into the issue myself and updated the code.