Title: few small problems
Last modified: November 11, 2019

---

# few small problems

 *  [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/few-small-problems/)
 * 1. I miss pageposttypes for some page types and for terms as single string so
   that i could use it in GA. This solves it for me:
 *     ```
       add_filter ( 'gtm4wp_compile_datalayer', 'centropol_gtm4wp_compile_datalayer' );
       function centropol_gtm4wp_compile_datalayer($datalayer) {
           if (!array_key_exists('pagePostType2', $datalayer)) {
             if ( is_404() ) {
                 $datalayer['pagePostType'] = 'error_404';
                 $datalayer['pagePostType2'] = 'error';
             }                                                     
             if ( is_search() ) {
                 $datalayer['pagePostType'] = 'search';
                 $datalayer['pagePostType2'] = 'search-'.get_query_var('paged');
             }    
             if (is_archive()) $datalayer['pagePostType2'] = 'archive-'.$datalayer['pagePostType'];       
           }
           if ($datalayer['pagePostTerms']) {
               foreach ($datalayer['pagePostTerms'] as $taxonomy => $terms) {
                   $datalayer['page-'.$taxonomy] = implode(',',$terms);
               }
           }
   
           return $datalayer;
       }
       ```
   
 * 2. that information from ipstack are interesting, but you should make the link
   protocol independent, so instead of
    country_flag”:”http:\/\/assets.ipstack.com\/
   flags\/cz.svg” there should be country_flag”:”\/\/assets.ipstack.com\/flags\/
   cz.svg” (ipstack supports both http and https)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * (@duracelltomi)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/few-small-problems/#post-12130617)
 * Hi,
 * I’ve created a ticket so that those changes could be included in v1.12:
    [https://github.com/duracelltomi/gtm4wp/issues/150](https://github.com/duracelltomi/gtm4wp/issues/150)
 * As for the ipstack data: http is returned by ipstack API, if they would return
   a protocol independent URL this plugin would output it as well. All I could do
   is a manual replace after querying data.

Viewing 1 replies (of 1 total)

The topic ‘few small problems’ is closed to new replies.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Thomas Geiger](https://wordpress.org/support/users/duracelltomi/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/few-small-problems/#post-12130617)
 * Status: not resolved