2

I think this is a Google Tag Manager bug, but I want to confirm.

I'm using Google Tag Manager with the preview mode, which opens the debugging tool in my site.

At first, the summary of fired tags will appear, and if I click the one that I'm interested in (Google Analytics - page view), I see the custom dimensions being set properly.

dimension: [
 {index: '1', dimension: "the value"},
 {index: '2', dimension: "the value"},
 ...
]

(I actually can't copy and paste from the debugging tool so I typed out something similar)

But then when I click around the list of events, and then go back to the Google Analytics page view event, the data changes to:

dimension: [
 {index: '1', dimension: undefined},
 {index: '2', dimension: undefined},
 ...
]

I could test this by myself (in the Google Analytics dashboard) but custom dimension data that's tracked this way takes a few hours to be reflected in the custom reports, so I want to understand why this happens.

In order to set the custom dimension values, I use DataLayer variables, where the values are inside an object (key is detail). The <%= %> is Ruby code outputting some values from the server-side.

<script type="text/javascript">
  var dataLayer = window.dataLayer || [];
  dataLayer.push({
    detail: {
      myId: <%= my_id %>,
      profileId: <%= profile_id %>,
      postId: <%= post_id %>
    }
  });

  </script>

Also I don't think I have messed up anything like the Javascript code crashing or wrong custom dimension settings on the GTM tags and variable configuration, because as I said, at the beginning the values appear correctly, and become undefined when I click around. I thought maybe GTM debugging tool cannot access values inside an object due to some bug in it, or something like that.

To clarify, values appear correctly in the Summary list (in the Tags Fired On This Page item), but when I browse the numbered events (1 Page View), the tag does appear in the Tags Fired On This Event item but with undefined data.

Also, I verified that no other event in the event list is firing the tag. Only the 1 Page View one. So this means that the one that appears in the summary and the 1 Page View are the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.