Expand my Community achievements bar.

SOLVED

Monthly Unique Visitors empty in API response

Avatar

Level 1

Hello,

I'm trying to extract daily and monthly unique visitors using the Analytics API, but the metrics are always returning 0 instead of the value seen in the Reports UI. The metric identifiers I'm using are metrics/visitorsmonthly and metrics/visitorsdaily.

An example JSON request:

{

    "rsid": "***",

    "globalFilters": [

        {

            "type": "dateRange",

            "dateRange": "2019-09-16T00:00:00/2019-09-17T00:00:00"

        }

    ],

    "metricContainer": {

        "metrics": [

            {

                "columnId": "pageviews",

                "id": "metrics/pageviews"

            },

            {

                "columnId": "videostart",

                "id": "metrics/videostart"

            },

            {

                "columnId": "timespentvisit",

                "id": "metrics/timespentvisit"

            },

            {

                "columnId": "visitorsmonthly",

                "id": "metrics/visitorsmonthly"

            },

            {

                "columnId": "visitorsdaily",

                "id": "metrics/visitorsdaily"

            }

        ]

    },

    "dimension": "variables/daterangeday",

    "settings": {

        "countRepeatInstances": true,

        "limit": 50,

        "page": 0,

        "dimensionSort": "asc"

    },

    "statistics": {

        "functions": [

            "col-max",

            "col-min"

        ]

    }

}

And the response:

{

  "totalPages": 1,

  "firstPage": true,

  "lastPage": true,

  "numberOfElements": 1,

  "number": 0,

  "totalElements": 1,

  "columns": {

    "dimension": {

      "id": "variables/daterangeday",

      "type": "time"

    },

    "columnIds": [

      "pageviews",

      "videostart",

      "timespentvisit",

      "visitorsmonthly",

      "visitorsdaily"

    ]

  },

  "rows": [

    {

      "itemId": "1190816",

      "value": "Sep 16, 2019",

      "data": [

        652710,

        685738,

        611.7979478807963,

        0,

        0

      ]

    }

  ],

  "summaryData": {

    "nonesFilteredTotals": [

      652710,

      685738,

      611.7979478807963,

      0,

      0

    ],

    "totals": [

      652710,

      685738,

      611.7979478807963,

      0,

      0

    ],

    "col-max": [

      652710,

      685738,

      611.7979478807963,

      0,

      0

    ],

    "col-min": [

      652710,

      685738,

      611.7979478807963,

      0,

      0

    ]

  }

}

Has anyone successfully used these metrics in the Analytics API? Am I missing a requirement for using them?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

API 2.0 and Analytics Workspace have the same "reporting engine". means if it is not available in workspace, I wouldn't expect it to be on any API 2.0 call....

View solution in original post

3 Replies

Avatar

Community Advisor

do you get numbers in Adobe Workspace when you create a similar table? and is it a VRS you are trying to fetch data from?

Avatar

Level 1

Daily/Monthly unique visits are not available in Workspace according to this thread: Why Daily, Weekly & Monthly Unique Visitor Metrics not showing up in the Workspace? The metrics are listed in the /metrics API response, so I figured they'd be supported in the API.

I'm not completely sure, but I don't think the RS is a VRS. I didn't set it up, and I can't find a way to identify if it is or not.

Avatar

Correct answer by
Community Advisor

API 2.0 and Analytics Workspace have the same "reporting engine". means if it is not available in workspace, I wouldn't expect it to be on any API 2.0 call....