Custom reports are empty in Google Analytics recei

2019-09-09 17:07发布

问题:

I want to create a custom report with custom dimensions and custom metrics, so I've created them as admin in GA and both have index 1.

I've added them in the dataLayer in my code:

var dataLayer = {'dimension1':'Custom Dimension 1','metric1':123456}

And after setting in GTM, I've checked data is being sent right in live mode:

But custom reports are empty, but activity on site is being registered.

This is the entire code of my site. I have tried adding both Google Tag Manager and Google Adwords codes but does not work in any case:

<body>
<script>
var dataLayer = [{
    'dimension1':'My Custom Dimension 1',
    'metric1': 123456
}]
</script>
    <!-- Google Tag Manager -->
    <!-- End Google Tag Manager -->
<h1>Nuevo alojamiento</h1>
<script>
    //GA CODE

    ga('create', 'UA-76206495-2', 'auto');
    ga('send', 'pageview');

</script>
</body>

回答1:

Pushing those values with those standard reference names in to GTM will not associate them with your hits, or make them show up in your reports. In GTM you need to grab the value of your CD and CM from the dataLayer. In this case you need to create dataLayer type variables that will give you access to dimension1 and metric1, although I would advise to rename them to something else other than the standard GA reference names, ie. dimensionX and metricX because that could be confusing. Then you need to pass the index and value for that CD and CM into whichever tag (page view, event, etc.) using those new names.

Edit: note that data won't show up in your standard reports until they have been processed, which takes up to 24 hours or so.



回答2:

As nyuen told me, I have to set those values in GTM, it was done bescause, if it wouldn't, data would not been sent. These are my settings

This sends the CD and CM in all pages. Custom vars are already set.

Preview mode of CTM displays this, it was fired:

And de dataLayer contains the data (I'm going to follow you advice and use another name):

So if I leave the preview mode and publish in GTM, I'm sure information is being sent, that is the GET request I placed before. Those values era in the URL as params (cd1 and cm1), so that is the reason why I'm pretty sure information is being sent to GA

Hope this extra information helps

UPDATE 1

I've changed dataLayer values to dim1 and met1 and now met1 is set to 123456789. Also, verified UA is right.

With those changes, chain sent to Google Analytics is the same (params are cd1 and cm1 with the appropiate values)