xdevplatform/twitter-ruby-ads-sdk

Is there a way to get campaign analytics?

Closed this issue · 0 comments

Issue Type: Question

Description:
I can get analytics of line_items.
Is there a way i can get analytics of campaigns?

since there is no stats method in Campaign model,
i tried to use stats method in Analytics model which still didn't work.

I got error message like below

#<TwitterAds::BadRequest:0x70141472902400 code=400 details="[{:code=>"INVALID_PARAMETER", :message=>"Expected value in CAMPAIGN, ORGANIC_TWEET, PROMOTED_TWEET, LINE_ITEM, FUNDING_INSTRUMENT, ACCOUNT, got \"\" for entity", :parameter=>"entity"}, {:code=>"INVALID_PARAMETER", :message=>"Expected value in HOUR, DAY, TOTAL, got \"DAILY\" for granularity", :parameter=>"granularity"}]">

Then i found there is no Campaign pair in ANALYTICS_MAP

twitter-ruby-ads-sdk/lib/twitter-ads/resources/analytics.rb

ANALYTICS_MAP = {
      'TwitterAds::LineItem' => 'LINE_ITEM'.freeze,
      'TwitterAds::OrganicTweet' => 'ORGANIC_TWEET'.freeze,
      'TwitterAds::Creative::PromotedTweet' => 'PROMOTED_TWEET'.freeze
    }.freeze

Is there another way to get campaign reports?