Hi,
Could someone please correct my json syntax? I am trying to get some detail report on a particular page URL.
I get my URLs from this first request below.
{
"reportDescription":{
"reportSuiteID":"MyReportSuiteID",
"dateFrom":"2010-02-11",
"dateTo":"2010-05-03",
"metrics":[
{"id":"visits"},
{"id":"pageviews"}
],
"sortBy":"page",
"elements":[
{
"id":"page",
"top":"50",
"startingWith":"1"
}
],
"locale":"en_US"
}
}
Then, I need to find out the detail data on "http:\/\/www.jjesquire.com\/Home Page", I do the following.
{
"reportDescription":{
"reportSuiteID":"MyReportSuiteID",
"dateFrom":"2010-02-11",
"dateTo":"2010-05-03",
"metrics":[
{"id":"visits"},
{"id":"pageviews"}
],
"sortBy":"page",
"elements":[
{
"id":"page",
"top":"50",
"startingWith":"1",
"search":{
"type":"and",
"keywords":[
"http:\/\/www.jjesquire.com\/Home Page"
]
}
}
],
"locale":"en_US"
}
}
However, this time, the data is empty.
{
"status":"done",
"statusMsg":"Your report has finished generating",
"report":{
"reportSuite":{
"id":"MySuiteID",
"name":"Test Feed Suite Name"
},
"period":"Thu. 11 Feb. 2010 - Mon. 3 May 2010",
"elements":[
{
"id":"page",
"name":"Page"
}
],
"metrics":[
{
"id":"visits",
"name":"Visits",
"type":"number"
},
{
"id":"pageviews",
"name":"Page Views",
"type":"number"
}
],
"type":"ranked",
"data":[
],
"totals":[
"10525",
"56140"
]
}
}
How should the search section of the elements be? Please advise.
Thanks and regards,
Cecilia
Hi Cecilia,
Your reportDefinition is fine. The problem is that you are expecting the search to apply to the "url" but it does not. It only applies to the "name" on a page element.
So if you simply changed the value in your "keywords" array to "Home Page" you will see the search return some results.
Reply
{
"reportDescription":{
"reportSuiteID":"MyReportSuiteID",
"dateFrom":"2010-02-11",
"dateTo":"2010-05-03",
"metrics":[
{"id":"visits"},
{"id":"pageviews"}
],
"sortBy":"page",
"elements":[
{
"id":"page",
"top":"50",
"startingWith":"1",
"search":{
"type":"and",
"keywords":[
"Home Page"
]
}
}
],
"locale":"en_US"
}
}
Hope that helps.
-Sean
Thank you for looking into it. If the information I have is the URL, I don't know the "name" b/c I did not actually do the first request. Is there any way to retrieve some page data by URL?
Thanks in advance.
Cecilia
Reply
No. As far as I know you will not be able to search on the "url" for the page element.
If you were to alter your implementation to capture the page url into a separate prop or evar then you could search on it.
-Sean
Reply