OAuth for Installed Apps with AdSense API

88 views
Skip to first unread message

Shane Niebergall

unread,
Jun 21, 2013, 2:04:44 PM6/21/13
to adsen...@googlegroups.com
Hey all!

I'm setting up a wordpress plugin that can pull adsense stats. Because it's a plugin, the redirect uri is different for every install, and I can't use an OAuth 2.0 client api key approach. I've found this article, which walks me through setting up OAuth for Installed Apps: http://www.ioncannon.net/programming/1443/google-oauth-for-installed-apps-php-example/

When I replicate the code in the example, all works great. But when I switch from the Analytics Api example to start using Adsense Management API, I'm getting an error:
"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup"

So, using this scope and api url works:

But this doesn't!

Can you think of any reason why? I've been scouring the Adsense documentation and I can't find anything that suggests its authentication is different than Analytics.

Thanks so much!!

Jose Alcérreca (AdSense API Team)

unread,
Jun 24, 2013, 9:29:41 AM6/24/13
to adsen...@googlegroups.com
Hi Shane!

Have you activated the AdSense Management API Service in the APIs console?


Cheers,
Jose

---
Jose Alcérreca
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

shan...@gmail.com

unread,
Jun 25, 2013, 10:12:59 AM6/25/13
to adsen...@googlegroups.com
Yes, I have 2 projects in there, both with access flipped to on. Do I need to be specifying my client id and client secret during my api call? I was hoping I wouldn't need to with this form of authentication.

Thanks!
Shane

Jose Alcérreca (AdSense API Team)

unread,
Jun 27, 2013, 6:04:32 AM6/27/13
to adsen...@googlegroups.com
Hi Shane,

Yes, you'll have to use the installed applications approach, with your client id and secret. Bear in mind that the quota limit will throttle your project so if you distribute the plugin you'll have limited usage control.

Cheers,
Jose

---
Jose Alcérreca
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902


Reply all
Reply to author
Forward
0 new messages