Hi. I tried to get video metrics using google-ads-ruby. I followed this doc:
https://developers.google.com/google-ads/api/fields/v3/video#fieldssegmentsmetrics

and built query like this:

require_relative './collector'
require 'google/ads/google_ads'

client = Google::Ads::GoogleAds::GoogleAdsClient.new(Dir.pwd + 
"/google_ads_config.rb")

query = <<~QUERY
  SELECT
    metrics.conversions,
    video.id
  FROM
    video
  WHERE 
    segments.conversion_action_category = PAGE_VIEW
QUERY

customer_id = "MY_CUSTOMER_ID"

responses = client.service.google_ads.search_stream(customer_id, query)
responses.each do |response|
  begin
    response.results.each do |row|
      metrics = row.metrics
      video = row.video
      puts "video.id: #{video.id}, metrics.conversions: #{metrics.conversions}"
    end
  end

end


but running this code causes GRPC error:
/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/grpc-1.27.0-universal-darwin
/src/ruby/lib/grpc/generic/active_call.rb:31:in `check_status': 3:Request 
contains an invalid argument. (GRPC::InvalidArgument)

additional info:

   - Removing WHERE clause successfully returns row.
   - All of these segments cause same InvalidArgument error:
      - 
      - 
      - segments.ad_network_type
      - segments.click_type
      - segments.conversion_action
      - segments.conversion_action_category
      - segments.conversion_action_name
   

I want to use these all segments to analyze video ads more in detail.
Any idea?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bdefe7ae-1d52-45dd-aceb-33f0d13c0ad1%40googlegroups.com.

Reply via email to