Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

API > classification campaigns : Invalid elements

Avatar

Level 1

Hello,

i am using your api to get report informations with campaign and code tracking.

I try this:

{

    "reportDescription":{

        "reportSuiteID":"MYRSID",

        "dateFrom":"2017-05-20",

        "dateTo":"2017-05-26",

        "metrics":[

            {"id":"revenue"},{"id":"orders"},{"id":"visits"},{"id":"bouncerate"}

        ],

        "sortBy":"revenue",

        "elements": [

{

"id": "trackingCode",

"classification": "Campaigns",

"top": 20,

"startingWith": 1

},

{

"id": "trackingCode",

"top": 20

}

]

     

    }

}

This code works well if i delete bracket with classification = campaigns.

But when i run this, i get the error : invalid element.

I need to get metrics with campaign name , not only trackingcode.

Do you have a solution ?

I try it by API Explorer v1.3 > Report > QueueRanked. THen Report > Get.

In API 1.4, i got Invalid classification \"Campaigns\" for element \"trackingcode\"",

Thanks.

Yohann

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Yohann,

Check if you have a classification for the tracking code setup as Campaigns. Check spelling as well. Is it plural?

I tried and got the result correctly.

{

    "reportDescription": {

          "reportSuiteID": "RSIDXXX",

          "dateFrom": "2017-05-25",

          "dateTo": "2017-05-31",

          "sortBy": "revenue",

          "metrics": [

              {"id": "revenue"},{"id": "orders"},{"id": "visits"},{"id": "bouncerate"}

          ],

          "elements": [

              {

                    "id": "trackingcode",

                    "classification": "Campaign",

                    "top": 20,

                    "startingWith": 1

              }

          ]

    }

}

-Hyder

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Hi Yohann,

Check if you have a classification for the tracking code setup as Campaigns. Check spelling as well. Is it plural?

I tried and got the result correctly.

{

    "reportDescription": {

          "reportSuiteID": "RSIDXXX",

          "dateFrom": "2017-05-25",

          "dateTo": "2017-05-31",

          "sortBy": "revenue",

          "metrics": [

              {"id": "revenue"},{"id": "orders"},{"id": "visits"},{"id": "bouncerate"}

          ],

          "elements": [

              {

                    "id": "trackingcode",

                    "classification": "Campaign",

                    "top": 20,

                    "startingWith": 1

              }

          ]

    }

}

-Hyder