Re: accountId and adClientId

405 views
Skip to first unread message

Jose Alcérreca (AdSense API Team)

unread,
Dec 26, 2012, 4:09:18 PM12/26/12
to adsen...@googlegroups.com
Hi Ashesh,

You can get a list of your ad clients using 


You may want to look for "AFC" as your productCode.

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


Google Inc.| Developer Relations | AdSense API Team | developers.google.com/adsense


On Wednesday, 26 December 2012 07:51:44 UTC, Ashesh wrote:
Hi,

Regarding https://developers.google.com/adsense/host/v4.1/accounts/adunits/get it requires accountId and adClientId.

I understand that we get accountId after calling Associationsessions: verify but from where do we get the adClientId?

Ashesh Bharadwaj

unread,
Dec 27, 2012, 3:39:29 AM12/27/12
to adsen...@googlegroups.com
Thanks Jose for the prompt reply :)
 
Now just one last thing before I could make this whole thing work.
 
How to get the adcode to show on pages?
 
 
I am using the onpage functionality to create a test ad by putting following values:
 
accountId: pub-xxx
adClientId: ca-pub-xx (seems to be same as accountId except tje "ca-" prefix)
contentAdsSettings":
{
"size":"SIZE_200_200"
"type": "TEXT"
}
 
The response is:
 
400 Bad Request
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
],
"code": 400,
"message": "Invalid Value"
}
}


--
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/adsense-api/-/_qQXJLiS_Q4J.

To post to this group, send email to adsen...@googlegroups.com.
To unsubscribe from this group, send email to adsense-api...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.



--
Regards,
 
Ashesh Bharadwaj

Ashesh Bharadwaj

unread,
Dec 29, 2012, 6:51:13 AM12/29/12
to adsen...@googlegroups.com
You guys respond so quickly so thought incase the previous message was missed. Bumping it again for your perusal :)
--
Regards,
 
Ashesh Bharadwaj

Jose Alcérreca (AdSense API Team)

unread,
Dec 29, 2012, 1:36:53 PM12/29/12
to adsen...@googlegroups.com, ash...@paradisepublishers.com
Hi Ashesh,

Use the getAdCode method. "Insert" is used to create new ad units.

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


Google Inc.| Developer Relations | AdSense API Team | developers.google.com/adsense



Ashesh Bharadwaj

unread,
Dec 31, 2012, 1:34:28 AM12/31/12
to adsen...@googlegroups.com
Hi Jose,
 
There are no ads in the newly created account. Where am I going to get the "adUnitId" if I have to use "getAdCode" before creating the ad?
 
 I was under impression that first we create the ad using "insert" which returns the "adUnitId" and then we call "getAdCode" with that "adUnitId" to get the HTML code for that ad.
 
 
 


To view this discussion on the web visit https://groups.google.com/d/msg/adsense-api/-/drRLH31DxK4J.

To post to this group, send email to adsen...@googlegroups.com.
To unsubscribe from this group, send email to adsense-api...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.



--
Regards,
 
Ashesh Bharadwaj

Sérgio Gomes (AdSense API Team)

unread,
Dec 31, 2012, 4:15:03 AM12/31/12
to adsen...@googlegroups.com, ash...@paradisepublishers.com
Hi Ashesh,

That's correct; first you create an ad unit, then you generate the ad code for it. You're getting an error because you're missing a number of properties on your ad unit. Check https://developers.google.com/adsense/host/v4.1/accounts/adunits for a full listing.

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

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


Ashesh Bharadwaj

unread,
Dec 31, 2012, 5:52:59 AM12/31/12
to adsen...@googlegroups.com
Hi Sérgio,
 
Thanks for the prompt reply.
 
I filled exactly the same values as in client library example "AddAdUnitToPublishers.php":
 
"contentAdsSettings": {
  "size": "SIZE_200_200",
  "type": "TEXT",
  "backupOption": {
   "color": "ffffff"
  }
},
"customStyle": {
  "colors": {
   "background": "ffffff",
   "border": "000000",
   "text": "000000",
   "title": "000000",
   "url": "0000ff"
  },
  "corners": "SQUARE",
  "font": {
   "family": "ACCOUNT_DEFAULT_FAMILY",
   "size": "ACCOUNT_DEFAULT_SIZE"
  },
  "kind": "adsensehost#adStyle"
},
"name": "Ad Unit Test"
}
 
and stil its giving me 400, invalid value. I have no clue what am I missing here?


To view this discussion on the web visit https://groups.google.com/d/msg/adsense-api/-/zbfNcLmH1nYJ.

To post to this group, send email to adsen...@googlegroups.com.
To unsubscribe from this group, send email to adsense-api...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.



--
Regards,
 
Ashesh Bharadwaj

Ashesh Bharadwaj

unread,
Jan 2, 2013, 2:38:49 AM1/2/13
to adsen...@googlegroups.com
Hi Sérgio,
 
Can you please any help me on my last post :)
--
Regards,
 
Ashesh Bharadwaj

Sérgio Gomes (AdSense API Team)

unread,
Jan 2, 2013, 8:23:19 AM1/2/13
to adsen...@googlegroups.com, ash...@paradisepublishers.com
Hi Ashesh,

Could you email us privately with the full logs (request and response) to this call, so that we can debug the issue? Thanks!

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

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



Cheers,
Jose

---


Google Inc.|<span style="border-style:solid;border-color:rgb(51,105,232);color:rgb(85,85,85);padding-top:2px;font-family:"trebuchet ms&quot...
Show original

Ashesh Bharadwaj

unread,
Jan 2, 2013, 8:26:10 AM1/2/13
to adsen...@googlegroups.com
Thanks a lot Sérgio. Sure will do that.


--
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/adsense-api/-/wO65fVouaU0J.

To post to this group, send email to adsen...@googlegroups.com.
To unsubscribe from this group, send email to adsense-api...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.



--
Regards,
 
Ashesh Bharadwaj

Sérgio Gomes (AdSense API Team)

unread,
Jan 2, 2013, 9:32:51 AM1/2/13
to adsen...@googlegroups.com, ash...@paradisepublishers.com
Hey everyone,

The problem turned out to be a couple of missing properties: backupOption.type and customStyle.colors.text.

The error messages in this situation aren't exactly the clearest, so I'll be talking to the team to see if we can improve on them for future releases.

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

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


On Wednesday, 2 January 2013 13:36:25 UTC, Ashesh wrote:
Thanks again Sérgio. I have emailed the data.
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204...
<a href="https://groups.google.c...
Show original
Reply all
Reply to author
Forward
0 new messages