Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

Fetching data via Reporting API, preventing dimension with value of 0

Avatar

Level 2

Hi,

I'm trying to fetch a very simple trended report, that gives me the amount of visits we got on tracking codes. The JSON I'm sending looks like this:

  "reportDescription":{

      "reportSuiteID":rs,

      "dateFrom":'2018-01-01',

      "dateTo":'2018-02-01',

      "dateGranularity":"day",

      "elements":[

          {"id":"eVar21"],

      "metrics" => [{"id" => "visits"}]

  }

The problems with the result I'm getting is:

1/ It returns only 10 items of eVar21

2/ There are also entries in that list that had no visits (visits:0)

3/ The result does not contain all my tracking codes with traffic

4/ The results differ from what I see within Workspace

Any idea how I can deal with these 4 problems?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

1.

You can control the number of elements it should return in a breakdown. A trended report is generally a breakdown of day by a dimension.

Try using this and modify the values accordingly:

{

  "reportDescription": {

    "reportSuiteID": "rsid",

    "dateFrom": "2018-01-01",

    "dateTo": "2018-02-01",

    "dateGranularity": "day",

    "metrics": [{"id": "visits"}],

    "elements": [

      {

        "id": "eVar21",

        "top": 10,

        "startingWith": 1

      }

    ]

  }

}

2.

As for your second question, the evar values are being brought for the top 10 currently in the overall date range you have selected. It may mean that those values may not be present or be the top 10 for each day. What the request is doing, is fetch the top X values of for the period and then trend it for the period.

3.

For finding out the segment ID, you go to Components > Segments, and search for you segment. The segment ID would be present at the end of the URL

View solution in original post

3 Replies

Avatar

Employee Advisor

Can you share a screenshot of the workspace report? what dimension and metrics are you using? Workspace has much more flexibility in terms of breakdown and segment application.

Avatar

Level 2

I think I already found the error. In my report suite I have two break-downs for Campaign ID, one for Tracking Code, one for eVar 21. While they should report the same, there is some discrepancy. Will check internally why this is the case.

Could you assist with the other queries maybe?

1/ It returns only 10 items of eVar21

2/ There are also entries in that list that had no visits (visits:0)

And one additional question:

3/ How do I find the ID of a custom segment in Omniture to use in the JSON Request?

Especially I'm looking for a way to only show values for eVar21 if they have had >=1 visits. Is that possible?

Avatar

Correct answer by
Employee Advisor

1.

You can control the number of elements it should return in a breakdown. A trended report is generally a breakdown of day by a dimension.

Try using this and modify the values accordingly:

{

  "reportDescription": {

    "reportSuiteID": "rsid",

    "dateFrom": "2018-01-01",

    "dateTo": "2018-02-01",

    "dateGranularity": "day",

    "metrics": [{"id": "visits"}],

    "elements": [

      {

        "id": "eVar21",

        "top": 10,

        "startingWith": 1

      }

    ]

  }

}

2.

As for your second question, the evar values are being brought for the top 10 currently in the overall date range you have selected. It may mean that those values may not be present or be the top 10 for each day. What the request is doing, is fetch the top X values of for the period and then trend it for the period.

3.

For finding out the segment ID, you go to Components > Segments, and search for you segment. The segment ID would be present at the end of the URL