About AdsAPI from RubyGem's AdWordsAPI

35 views
Skip to first unread message

KimihiroMurayama

unread,
Oct 26, 2022, 1:58:27 AM10/26/22
to Google Ads API and AdWords API Forum
Hello 

I would like to reproduce the process that is working in the following AdWordsAPI Gem with AdsAPI.
I am posting an example code.
If anyone knows how to reproduce it with AdsAPI, please let me know.

CodeSample1.

require 'adwords_api

...


def example1

    @adwords_api = AdwordsApi::Api.new(Rails.configuration.adwords_auth)

    kind_of_service = :CampaignService

    @service = @adwords_api.service(kind_of_service, Rails.configuration.adwords_api_version)

    selector = {:fields=>["Id", "Name", "Status"], :predicates=>[], :ordering=>[{:field=>"Name", :sort_order=>"ASCENDING"}], :paging=>{:start_index=>1, :number_results=>1}}

    @service.get(selector)

  end

end

Other values for :kind_of_service may include
:AdGroupAdService
:AdGroupCriterionService
:AdGroupService
AdwordsUserListService
There are also multiple patterns for selector.

Question2.

There is a section that uses download_report.
I would like to know how to reproduce this with AdsAPI.
The report_definition is an example of what is expected.

  def example2

    adwords_api = AdwordsApi::Api.new(Rails.configuration.adwords_auth)

     ...

    reporter = adwords_api.report_utils(Rails.configuration.adwords_api_version)

    report_definition = {:selector=>{:fields=>["Date", "CampaignId", "AdGroupId", "Id", "CriterionId", "Device", "AdType", "Cost", "Impressions", "Clicks", "Conversions", "AveragePosition"], :date_range=>{:min=>"20221025", :max=>"20221025"}},

 :report_name=>"AD_PERFORMANCE_REPORT",

 :report_type=>"AD_PERFORMANCE_REPORT",

 :date_range_type=>"CUSTOM_DATE",

 :download_format=>"TSV"}

    raw_report = reporter.download_report(report_definition)

  end




Google Ads API Forum Advisor

unread,
Oct 26, 2022, 6:21:23 AM10/26/22
to kimihiro...@livesense.co.jp, adwor...@googlegroups.com
Hi Kimihiro,

Thank you for reaching us out. I am Sherwin from Google Ads API support team. I hope that you are doing well today.

Moving forward to your concern, we can see here that you created 2 separate threads with the same issue. My colleague Carmela already replied to the other thread with a subject "Regarding RubyGem's migration from AdWordsAPI to AdsAPI". With that being said, please reply to that thread as my colleague already replied to it to avoid confusion.

Kind regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 
​​​​​​​

ref:_00D1U1174p._5004Q2foFB4:ref

KimihiroMurayama

unread,
Oct 26, 2022, 10:13:57 PM10/26/22
to Google Ads API and AdWords API Forum
Thank you.
2022年10月26日水曜日 19:21:23 UTC+9 adsapi:
Reply all
Reply to author
Forward
0 new messages