0
votes

I can get content owner report from this tesing url below (section Try it) https://developers.google.com/youtube/analytics/v1/

ids = contentOwner=={MycontentOwner}

start-date = 2013-05-01

end-date = 2013-05-31

metrics = views

dimensions = day

filters = claimedStatus==claimed

sort = day

But I can't get report by channel

ids = channel=={Mychannel}

start-date = 2013-05-01

end-date = 2013-05-31

metrics = views

dimensions = day

sort = day

Get error below.

400 Bad Request - Show headers - { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid value (Mychannel) given in field parameters.ids." } ], "code": 400, "message": "Invalid value (Mychannel) given in field parameters.ids." }}

content owner is name that show on cms , channel is user name on youtube website. right?

On youtube analytics report, there is Mychannel in Content Owner account . But why I can't get data from Mychannel via tesing url (section Try it)?

Edit:

I think ,I knew it. channel==CHANNEL_ID, where CHANNEL_ID specifies the unique channel ID for your channel. The value is currently a string that begins with the letters UC, though its format is subject to change. (You can retrieve your channel's ID using the YouTube Data API's channels.list method.)

I have another way to get channel report.

ids = contentOwner=={MycontentOwner}

filter = channel=MychannelID

Thank you.

1

1 Answers

0
votes

You can ask for your channels list using the following code:

var request = gapi.client.youtube.channels.list({ 
    mine: 'true', 
    part: 'contentDetails,id', 
    metrics: 'views,comments,favoritesAdded,favoritesRemoved,likes,dislikes,shares' 
});