Hi, thanks for your reply, sorry I didn't see this for a while

If there are no ad group ids, what do I stick in the
'INSERT_AD_GROUP_ID_HERE' section in the below code?

This is from:

http://code.google.com/p/google-api-adwords-ruby/source/browse/branches/v19.1.0/examples/v201003/add_ads.rb?spec=svn59&r=59


def add_ads()
  # AdWords::AdWordsCredentials.new will read a credentials file from
  # ENV['HOME']/adwords.properties when called without parameters.
  adwords = AdWords::API.new
  ad_group_ad_srv = adwords.get_service('AdGroupAd', API_VERSION)

  ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i
  video_media_id = 'INSERT_VIDEO_MEDIA_ID_HERE'.to_i

  # Create text ad.
  # The 'module' method being called here provides a shortcut to the
  # module containing the classes for this service. This helps us
avoid
  # typing the full class name every time we need to create an object.
  text_ad = ad_group_ad_srv.module::TextAd.new
  text_ad.headline = 'Luxury Cruise to Mars'
  text_ad.description1 = 'Visit the Red Planet in style.'
  text_ad.description2 = 'Low-gravity fun for everyone!'
  text_ad.url = 'http://www.example.com'
  text_ad.displayUrl = 'www.example.com'
  text_ad_operation = ad_group_ad_srv.module::AdGroupAdOperation.new
  text_ad_operation.operand = {
    :adGroupId => ad_group_id,
    :ad => text_ad
  }
  text_ad_operation.operator = 'ADD'


Cheers

Nick

On Nov 9, 3:59 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> Hi Nicholas,
>
> There is no supported way to get an ad groupIDfrom the Adwords web
> interface.  You'll need to request all ad groups in the campaign and
> choose the one with the same name.
>
> Best,
> - Eric Koleda, AdWords API Team
>
> On Nov 5, 12:52 pm, Nicholas Hibberd <ni...@yourgolftravel.com> wrote:
>
> > Hi,
>
> > Quick question.
>
> > I've just got going with the Adwords API, and have been trying to
> > upload a test ad to one of our adgroups.
>
> > I took what I took to be theadgroupidfrom the url string when
> > browsing to theadgroupin question, but this did not work, and I
> > couldn't think how else to find anadgroupid?
>
> > SOAP Error: [EntityNotFound.INVALID_ID @
> > operations[0].operand.adGroupId; trigger:'AdGroupId:
> > 55731815324317463']
>
> > Cheers

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to