embulk-input-facebook_ads_insights 0.1.2 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 216c608f834dd00d357b5065f346317c1ab0e23b
4
- data.tar.gz: e3c360c8ef84d04c4e4119bba18d7124781f955f
3
+ metadata.gz: 07a75cf04063a498b5388595c28563db0ae6f766
4
+ data.tar.gz: e7bf8a70fdf450a6f2c9f53aac1f8e4a96e27a8a
5
5
  SHA512:
6
- metadata.gz: dcfd7142941bc480c15372b6efa2f297dccbbe6788e762b79598ea6d63bf7d5e3699e6c4c3deeef8ea161fed1b8f54eb4e1cb4ef44ac68fa9589bdff6955028d
7
- data.tar.gz: ccfc9c175adde3185f571fe9404b6e313ceb7bed174a5aa0d7d94721a7c12766c7e6ced0c00fc4ed2652bab413921b33f83441c4b83bf26a9c4572b55a999bc9
6
+ metadata.gz: 1894b62794582b46dd920b7a0b5e969918c4f38d16517f7847e70cd45086db55d41df91985fef18b3bbce2664699dc9a97e0d70d55f4e701a1d57ae33a9e3955
7
+ data.tar.gz: 83acf94ddd0b9222dfa5ded9a69b7350d78841ed3ff2226c1021d5a288f4c26b2f4a27f75b5ba78c917d85fb17071605133bffe648ecd642fcec68f368db442c
data/README.md CHANGED
@@ -38,9 +38,9 @@ Required Embulk version >= 0.9
38
38
  | Name | Values |
39
39
  |:----------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
40
40
  | ObjectEnum | account, campaign, adset, ad |
41
- | FieldEnum | account_currency, account_id, account_name, action_values, actions, ad_id, ad_name, adset_id, adset_name, app_store_clicks, buying_type, campaign_id, campaign_name, canvas_avg_view_percent, canvas_avg_view_time, clicks, conversion_rate_ranking, conversion_values, conversions, cost_per_10_sec_video_view, cost_per_action_type, cost_per_conversion, cost_per_estimated_ad_recallers, cost_per_inline_link_click, cost_per_inline_post_engagement, cost_per_outbound_click, cost_per_thruplay, cost_per_unique_action_type, cost_per_unique_click, cost_per_unique_inline_link_click, cost_per_unique_outbound_click, cpc, cpm, cpp, ctr, date_start, date_stop, deeplink_clicks, engagement_rate_ranking, estimated_ad_recall_rate, estimated_ad_recallers, frequency, full_view_impressions, full_view_reach, impressions, inline_link_click_ctr, inline_link_clicks, inline_post_engagement, instant_experience_clicks_to_open, instant_experience_clicks_to_start, instant_experience_outbound_clicks, mobile_app_purchase_roas, newsfeed_avg_position, newsfeed_clicks, newsfeed_impressions, objective, outbound_clicks, outbound_clicks_ctr, purchase_roas, quality_ranking, reach, relevance_score, social_spend, spend, unique_actions, unique_clicks, unique_ctr, unique_impressions, unique_inline_link_click_ctr, unique_inline_link_clicks, unique_link_clicks_ctr, unique_outbound_clicks, unique_outbound_clicks_ctr, video_10_sec_watched_actions, video_30_sec_watched_actions, video_avg_time_watched_actions, video_complete_watched_actions, video_p100_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_play_actions, video_thruplay_watched_actions, website_clicks, website_ctr, website_purchase_roas |
41
+ | FieldEnum | account_currency, account_id, account_name, action_values, actions, ad_bid_type, ad_bid_value, ad_click_actions, ad_delivery, ad_id, ad_impression_actions, ad_name, adset_bid_type, adset_bid_value, adset_budget_type, adset_budget_value, adset_delivery, adset_end, adset_id, adset_name, adset_start, age_targeting, auction_bid, auction_competitiveness, auction_max_competitor_bid, buying_type, campaign_id, campaign_name, canvas_avg_view_percent, canvas_avg_view_time, clicks, conversion_rate_ranking, conversion_values, conversions, cost_per_15_sec_video_view, cost_per_2_sec_continuous_video_view, cost_per_action_type, cost_per_ad_click, cost_per_conversion, cost_per_dda_countby_convs, cost_per_estimated_ad_recallers, cost_per_inline_link_click, cost_per_inline_post_engagement, cost_per_one_thousand_ad_impression, cost_per_outbound_click, cost_per_store_visit_action, cost_per_thruplay, cost_per_unique_action_type, cost_per_unique_click, cost_per_unique_conversion, cost_per_unique_inline_link_click, cost_per_unique_outbound_click, cpc, cpm, cpp, created_time, ctr, date_start, date_stop, dda_countby_convs, engagement_rate_ranking, estimated_ad_recall_rate, estimated_ad_recall_rate_lower_bound, estimated_ad_recall_rate_upper_bound, estimated_ad_recallers, estimated_ad_recallers_lower_bound, estimated_ad_recallers_upper_bound, frequency, full_view_impressions, full_view_reach, gender_targeting, impressions, inline_link_click_ctr, inline_link_clicks, inline_post_engagement, instant_experience_clicks_to_open, instant_experience_clicks_to_start, instant_experience_outbound_clicks, labels, location, mobile_app_purchase_roas, objective, outbound_clicks, outbound_clicks_ctr, place_page_name, purchase_roas, quality_ranking, quality_score_ectr, quality_score_ecvr, quality_score_organic, reach, social_spend, spend, store_visit_actions, unique_actions, unique_clicks, unique_conversions, unique_ctr, unique_inline_link_click_ctr, unique_inline_link_clicks, unique_link_clicks_ctr, unique_outbound_clicks, unique_outbound_clicks_ctr, unique_video_continuous_2_sec_watched_actions, unique_video_view_15_sec, updated_time, video_15_sec_watched_actions, video_30_sec_watched_actions, video_avg_time_watched_actions, video_continuous_2_sec_watched_actions, video_p100_watched_actions, video_p25_watched_actions, video_p50_watched_actions, video_p75_watched_actions, video_p95_watched_actions, video_play_actions, video_thruplay_watched_actions, video_time_watched_actions, website_ctr, website_purchase_roas, wish_bid |
42
42
  | ActionAttributionWindowEnum | 1d_view, 7d_view, 28d_view, 1d_click, 7d_click, 28d_click, default |
43
- | ActionBreakdownEnum | action_converted_product_id, action_device, action_canvas_component_name, action_carousel_card_id, action_carousel_card_name, action_destination, action_reaction, action_target_id, action_type, action_video_sound, action_video_type |
43
+ | ActionBreakdownEnum | action_device, action_canvas_component_name, action_carousel_card_id, action_carousel_card_name, action_destination, action_reaction, action_target_id, action_type, action_video_sound, action_video_type |
44
44
  | BreakdownEnum | ad_format_asset, age, body_asset, call_to_action_asset, country, description_asset, gender, image_asset, impression_device, link_url_asset, product_id, region, title_asset, video_asset, dma, frequency_value, hourly_stats_aggregated_by_advertiser_time_zone, hourly_stats_aggregated_by_audience_time_zone, place_page_id, publisher_platform, platform_position, device_platform |
45
45
  | DatePresetEnum | today, yesterday, this_month, last_month, this_quarter, lifetime, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year |
46
46
  | FilteringOperatorEnum | EQUAL, NOT_EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, IN_RANGE, NOT_IN_RANGE, CONTAIN, NOT_CONTAIN, IN, NOT_IN, STARTS_WITH, ANY, ALL, AFTER, BEFORE, NONE} |
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.2"
16
+ version = "0.1.7"
17
17
 
18
18
  sourceCompatibility = 1.8
19
19
  targetCompatibility = 1.8
@@ -21,7 +21,7 @@ targetCompatibility = 1.8
21
21
  dependencies {
22
22
  compile "org.embulk:embulk-core:0.9.17"
23
23
  provided "org.embulk:embulk-core:0.9.17"
24
- compile group: "com.facebook.business.sdk", name: "facebook-java-business-sdk", version: "4.0.5"
24
+ compile group: "com.facebook.business.sdk", name: "facebook-java-business-sdk", version: "8.0.2"
25
25
  // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
26
26
  testCompile "junit:junit:4.+"
27
27
  }
@@ -29,11 +29,26 @@ public class AdsInsightsAccessor
29
29
  case "account_name": return adsInsights.getFieldAccountName();
30
30
  case "action_values": return actionsToString(adsInsights.getFieldActionValues());
31
31
  case "actions": return actionsToString(adsInsights.getFieldActions());
32
+ case "ad_bid_type": return adsInsights.getFieldAdBidType();
33
+ case "ad_bid_value": return adsInsights.getFieldAdBidValue();
34
+ case "ad_click_actions": return actionsToString(adsInsights.getFieldAdClickActions());
35
+ case "ad_delivery": return adsInsights.getFieldAdDelivery();
32
36
  case "ad_id": return adsInsights.getFieldAdId();
37
+ case "ad_impression_actions": return actionsToString(adsInsights.getFieldAdImpressionActions());
33
38
  case "ad_name": return adsInsights.getFieldAdName();
39
+ case "adset_bid_type": return adsInsights.getFieldAdsetBidType();
40
+ case "adset_bid_value": return adsInsights.getFieldAdsetBidValue();
41
+ case "adset_budget_type": return adsInsights.getFieldAdsetBudgetType();
42
+ case "adset_budget_value": return adsInsights.getFieldAdsetBudgetValue();
43
+ case "adset_delivery": return adsInsights.getFieldAdsetDelivery();
44
+ case "adset_end": return adsInsights.getFieldAdsetEnd();
34
45
  case "adset_id": return adsInsights.getFieldAdsetId();
35
46
  case "adset_name": return adsInsights.getFieldAdsetName();
36
- case "app_store_clicks": return adsInsights.getFieldAppStoreClicks();
47
+ case "adset_start": return adsInsights.getFieldAdsetStart();
48
+ case "age_targeting": return adsInsights.getFieldAgeTargeting();
49
+ case "auction_bid": return adsInsights.getFieldAuctionBid();
50
+ case "auction_competitiveness": return adsInsights.getFieldAuctionCompetitiveness();
51
+ case "auction_max_competitor_bid": return adsInsights.getFieldAuctionMaxCompetitorBid();
37
52
  case "buying_type": return adsInsights.getFieldBuyingType();
38
53
  case "campaign_id": return adsInsights.getFieldCampaignId();
39
54
  case "campaign_name": return adsInsights.getFieldCampaignName();
@@ -43,31 +58,43 @@ public class AdsInsightsAccessor
43
58
  case "conversion_rate_ranking": return adsInsights.getFieldConversionRateRanking();
44
59
  case "conversion_values": return actionsToString(adsInsights.getFieldConversionValues());
45
60
  case "conversions": return actionsToString(adsInsights.getFieldConversions());
46
- case "cost_per_10_sec_video_view": return actionsToString(adsInsights.getFieldCostPer10SecVideoView());
61
+ case "cost_per_15_sec_video_view": return actionsToString(adsInsights.getFieldCostPer15SecVideoView());
62
+ case "cost_per_2_sec_continuous_video_view": return actionsToString(adsInsights.getFieldCostPer2SecContinuousVideoView());
47
63
  case "cost_per_action_type": return actionsToString(adsInsights.getFieldCostPerActionType());
64
+ case "cost_per_ad_click": return actionsToString(adsInsights.getFieldCostPerAdClick());
48
65
  case "cost_per_conversion": return actionsToString(adsInsights.getFieldCostPerConversion());
66
+ case "cost_per_dda_countby_convs": return adsInsights.getFieldCostPerDdaCountbyConvs();
49
67
  case "cost_per_estimated_ad_recallers": return adsInsights.getFieldCostPerEstimatedAdRecallers();
50
68
  case "cost_per_inline_link_click": return adsInsights.getFieldCostPerInlineLinkClick();
51
69
  case "cost_per_inline_post_engagement": return adsInsights.getFieldCostPerInlinePostEngagement();
70
+ case "cost_per_one_thousand_ad_impression": return actionsToString(adsInsights.getFieldCostPerOneThousandAdImpression());
52
71
  case "cost_per_outbound_click": return actionsToString(adsInsights.getFieldCostPerOutboundClick());
72
+ case "cost_per_store_visit_action": return actionsToString(adsInsights.getFieldCostPerStoreVisitAction());
53
73
  case "cost_per_thruplay": return actionsToString(adsInsights.getFieldCostPerThruplay());
54
74
  case "cost_per_unique_action_type": return actionsToString(adsInsights.getFieldCostPerUniqueActionType());
55
75
  case "cost_per_unique_click": return adsInsights.getFieldCostPerUniqueClick();
76
+ case "cost_per_unique_conversion": return actionsToString(adsInsights.getFieldCostPerUniqueConversion());
56
77
  case "cost_per_unique_inline_link_click": return adsInsights.getFieldCostPerUniqueInlineLinkClick();
57
78
  case "cost_per_unique_outbound_click": return actionsToString(adsInsights.getFieldCostPerUniqueOutboundClick());
58
79
  case "cpc": return adsInsights.getFieldCpc();
59
80
  case "cpm": return adsInsights.getFieldCpm();
60
81
  case "cpp": return adsInsights.getFieldCpp();
82
+ case "created_time": return adsInsights.getFieldCreatedTime();
61
83
  case "ctr": return adsInsights.getFieldCtr();
62
84
  case "date_start": return adsInsights.getFieldDateStart();
63
85
  case "date_stop": return adsInsights.getFieldDateStop();
64
- case "deeplink_clicks": return adsInsights.getFieldDeeplinkClicks();
86
+ case "dda_countby_convs": return adsInsights.getFieldDdaCountbyConvs();
65
87
  case "engagement_rate_ranking": return adsInsights.getFieldEngagementRateRanking();
66
88
  case "estimated_ad_recall_rate": return adsInsights.getFieldEstimatedAdRecallRate();
89
+ case "estimated_ad_recall_rate_lower_bound": return adsInsights.getFieldEstimatedAdRecallRateLowerBound();
90
+ case "estimated_ad_recall_rate_upper_bound": return adsInsights.getFieldEstimatedAdRecallRateUpperBound();
67
91
  case "estimated_ad_recallers": return adsInsights.getFieldEstimatedAdRecallers();
92
+ case "estimated_ad_recallers_lower_bound": return adsInsights.getFieldEstimatedAdRecallersLowerBound();
93
+ case "estimated_ad_recallers_upper_bound": return adsInsights.getFieldEstimatedAdRecallersUpperBound();
68
94
  case "frequency": return adsInsights.getFieldFrequency();
69
95
  case "full_view_impressions": return adsInsights.getFieldFullViewImpressions();
70
96
  case "full_view_reach": return adsInsights.getFieldFullViewReach();
97
+ case "gender_targeting": return adsInsights.getFieldGenderTargeting();
71
98
  case "impressions": return adsInsights.getFieldImpressions();
72
99
  case "inline_link_click_ctr": return adsInsights.getFieldInlineLinkClickCtr();
73
100
  case "inline_link_clicks": return adsInsights.getFieldInlineLinkClicks();
@@ -75,41 +102,49 @@ public class AdsInsightsAccessor
75
102
  case "instant_experience_clicks_to_open": return adsInsights.getFieldInstantExperienceClicksToOpen();
76
103
  case "instant_experience_clicks_to_start": return adsInsights.getFieldInstantExperienceClicksToStart();
77
104
  case "instant_experience_outbound_clicks": return adsInsights.getFieldInstantExperienceOutboundClicks();
105
+ case "labels": return adsInsights.getFieldLabels();
106
+ case "location": return adsInsights.getFieldLocation();
78
107
  case "mobile_app_purchase_roas": return actionsToString(adsInsights.getFieldMobileAppPurchaseRoas());
79
- case "newsfeed_avg_position": return adsInsights.getFieldNewsfeedAvgPosition();
80
- case "newsfeed_clicks": return adsInsights.getFieldNewsfeedClicks();
81
- case "newsfeed_impressions": return adsInsights.getFieldNewsfeedImpressions();
82
108
  case "objective": return adsInsights.getFieldObjective();
83
109
  case "outbound_clicks": return actionsToString(adsInsights.getFieldOutboundClicks());
84
110
  case "outbound_clicks_ctr": return actionsToString(adsInsights.getFieldOutboundClicksCtr());
111
+ case "place_page_name": return adsInsights.getFieldPlacePageName();
85
112
  case "purchase_roas": return actionsToString(adsInsights.getFieldPurchaseRoas());
86
113
  case "quality_ranking": return adsInsights.getFieldQualityRanking();
114
+ case "quality_score_ectr": return adsInsights.getFieldQualityScoreEctr();
115
+ case "quality_score_ecvr": return adsInsights.getFieldQualityScoreEcvr();
116
+ case "quality_score_organic": return adsInsights.getFieldQualityScoreOrganic();
87
117
  case "reach": return adsInsights.getFieldReach();
88
- case "relevance_score": return adsInsights.getFieldRelevanceScore().toString();
89
118
  case "social_spend": return adsInsights.getFieldSocialSpend();
90
119
  case "spend": return adsInsights.getFieldSpend();
120
+ case "store_visit_actions": return actionsToString(adsInsights.getFieldStoreVisitActions());
91
121
  case "unique_actions": return actionsToString(adsInsights.getFieldUniqueActions());
92
122
  case "unique_clicks": return adsInsights.getFieldUniqueClicks();
123
+ case "unique_conversions": return actionsToString(adsInsights.getFieldUniqueConversions());
93
124
  case "unique_ctr": return adsInsights.getFieldUniqueCtr();
94
- case "unique_impressions": return adsInsights.getFieldUniqueImpressions();
95
125
  case "unique_inline_link_click_ctr": return adsInsights.getFieldUniqueInlineLinkClickCtr();
96
126
  case "unique_inline_link_clicks": return adsInsights.getFieldUniqueInlineLinkClicks();
97
127
  case "unique_link_clicks_ctr": return adsInsights.getFieldUniqueLinkClicksCtr();
98
128
  case "unique_outbound_clicks": return actionsToString(adsInsights.getFieldUniqueOutboundClicks());
99
129
  case "unique_outbound_clicks_ctr": return actionsToString(adsInsights.getFieldUniqueOutboundClicksCtr());
100
- case "video_10_sec_watched_actions": return actionsToString(adsInsights.getFieldVideo10SecWatchedActions());
130
+ case "unique_video_continuous_2_sec_watched_actions": return actionsToString(adsInsights.getFieldUniqueVideoContinuous2SecWatchedActions());
131
+ case "unique_video_view_15_sec": return actionsToString(adsInsights.getFieldUniqueVideoView15Sec());
132
+ case "updated_time": return adsInsights.getFieldUpdatedTime();
133
+ case "video_15_sec_watched_actions": return actionsToString(adsInsights.getFieldVideo15SecWatchedActions());
101
134
  case "video_30_sec_watched_actions": return actionsToString(adsInsights.getFieldVideo30SecWatchedActions());
102
135
  case "video_avg_time_watched_actions": return actionsToString(adsInsights.getFieldVideoAvgTimeWatchedActions());
103
- case "video_complete_watched_actions": return actionsToString(adsInsights.getFieldVideoCompleteWatchedActions());
136
+ case "video_continuous_2_sec_watched_actions": return actionsToString(adsInsights.getFieldVideoContinuous2SecWatchedActions());
104
137
  case "video_p100_watched_actions": return actionsToString(adsInsights.getFieldVideoP100WatchedActions());
105
138
  case "video_p25_watched_actions": return actionsToString(adsInsights.getFieldVideoP25WatchedActions());
106
139
  case "video_p50_watched_actions": return actionsToString(adsInsights.getFieldVideoP50WatchedActions());
107
140
  case "video_p75_watched_actions": return actionsToString(adsInsights.getFieldVideoP75WatchedActions());
141
+ case "video_p95_watched_actions": return actionsToString(adsInsights.getFieldVideoP95WatchedActions());
108
142
  case "video_play_actions": return actionsToString(adsInsights.getFieldVideoPlayActions());
109
143
  case "video_thruplay_watched_actions": return actionsToString(adsInsights.getFieldVideoThruplayWatchedActions());
110
- case "website_clicks": return adsInsights.getFieldWebsiteClicks();
144
+ case "video_time_watched_actions": return actionsToString(adsInsights.getFieldVideoTimeWatchedActions());
111
145
  case "website_ctr": return actionsToString(adsInsights.getFieldWebsiteCtr());
112
146
  case "website_purchase_roas": return actionsToString(adsInsights.getFieldWebsitePurchaseRoas());
147
+ case "wish_bid": return adsInsights.getFieldWishBid();
113
148
  // breakdowns
114
149
  case "ad_format_asset": return extractBreakdown("ad_format_asset");
115
150
  case "age": return extractBreakdown("age");
@@ -16,7 +16,9 @@ import org.embulk.spi.ColumnConfig;
16
16
  import org.slf4j.Logger;
17
17
  import org.slf4j.LoggerFactory;
18
18
 
19
+ import java.util.ArrayList;
19
20
  import java.util.List;
21
+ import java.util.Objects;
20
22
  import java.util.stream.Collectors;
21
23
 
22
24
  public class Client
@@ -31,7 +33,7 @@ public class Client
31
33
  this.pluginTask = pluginTask;
32
34
  }
33
35
 
34
- public APINodeList<AdsInsights> getInsights() throws APIException, InterruptedException
36
+ public List<AdsInsights> getInsights(boolean isPaginationValid) throws APIException, InterruptedException
35
37
  {
36
38
  AdReportRun adReportRun;
37
39
  switch (pluginTask.getObjectType()) {
@@ -53,10 +55,30 @@ public class Client
53
55
  }
54
56
  default: throw new IllegalArgumentException();
55
57
  }
58
+ logger.info(adReportRun.getRawResponse());
56
59
  while (adReportRun.fetch().getFieldAsyncPercentCompletion() != 100) {
60
+ logger.info(adReportRun.getRawResponse());
57
61
  Thread.sleep(ASYNC_SLEEP_TIME);
58
62
  }
59
- return adReportRun.getInsights().execute();
63
+ logger.info(adReportRun.getRawResponse());
64
+ // extra waiting
65
+ int retryCount = 0;
66
+ boolean succeeded = false;
67
+ APINodeList<AdsInsights> adsInsights = null;
68
+ while (retryCount < pluginTask.getMaxWeightSeconds() && !succeeded) {
69
+ try {
70
+ Thread.sleep(1000);
71
+ adsInsights = adReportRun.getInsights().execute();
72
+ succeeded = true;
73
+ }
74
+ catch (APIException e) {
75
+ retryCount++;
76
+ }
77
+ }
78
+ if (Objects.isNull(adsInsights)) {
79
+ throw new APIException();
80
+ }
81
+ return isPaginationValid ? fetchAllPage(adsInsights) : adsInsights;
60
82
  }
61
83
 
62
84
  // TODO: plz make me dry
@@ -244,6 +266,17 @@ public class Client
244
266
  return request.execute();
245
267
  }
246
268
 
269
+ private List<AdsInsights> fetchAllPage(APINodeList<AdsInsights> adsInsights) throws APIException
270
+ {
271
+ List<AdsInsights> result = new ArrayList<>();
272
+ APINodeList<AdsInsights> next = adsInsights;
273
+ while (!next.isEmpty()) {
274
+ result.addAll(next);
275
+ next = next.nextPage();
276
+ }
277
+ return result;
278
+ }
279
+
247
280
  private APIContext apiContext()
248
281
  {
249
282
  return new APIContext(pluginTask.getAccessToken());
@@ -56,7 +56,7 @@ public class FacebookAdsInsightsInputPlugin
56
56
  try {
57
57
  try (PageBuilder pageBuilder = new PageBuilder(Exec.getBufferAllocator(), schema, output)) {
58
58
  Client client = new Client(task);
59
- List<AdsInsights> insights = client.getInsights();
59
+ List<AdsInsights> insights = client.getInsights(!Exec.isPreview());
60
60
  for (AdsInsights insight : insights) {
61
61
  schema.visitColumns(new FacebookAdsInsightsColumnVisitor(insight, pageBuilder, task));
62
62
  pageBuilder.addRecord();
@@ -81,4 +81,8 @@ public interface PluginTask extends Task
81
81
  @Config("use_account_attribution_setting")
82
82
  @ConfigDefault("null")
83
83
  public Optional<Boolean> getUseAccountAttributionSetting();
84
+
85
+ @Config("max_wait_seconds")
86
+ @ConfigDefault("60")
87
+ public Integer getMaxWeightSeconds();
84
88
  }
@@ -25,7 +25,6 @@ public class ActionBreakdown
25
25
  public static ActionBreakdown fromString(final String value)
26
26
  {
27
27
  switch (value) {
28
- case "action_converted_product_id": return new ActionBreakdown(AdsInsights.EnumActionBreakdowns.VALUE_ACTION_CONVERTED_PRODUCT_ID);
29
28
  case "action_device": return new ActionBreakdown(AdsInsights.EnumActionBreakdowns.VALUE_ACTION_DEVICE);
30
29
  case "action_canvas_component_name": return new ActionBreakdown(AdsInsights.EnumActionBreakdowns.VALUE_ACTION_CANVAS_COMPONENT_NAME);
31
30
  case "action_carousel_card_id": return new ActionBreakdown(AdsInsights.EnumActionBreakdowns.VALUE_ACTION_CAROUSEL_CARD_ID);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-facebook_ads_insights
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - naotaka nakane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2020-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -50,12 +50,12 @@ files:
50
50
  - README.md
51
51
  - build.gradle
52
52
  - classpath/annotations-13.0.jar
53
- - classpath/embulk-input-facebook_ads_insights-0.1.2.jar
54
- - classpath/facebook-java-business-sdk-4.0.5.jar
53
+ - classpath/embulk-input-facebook_ads_insights-0.1.7.jar
54
+ - classpath/facebook-java-business-sdk-8.0.2.jar
55
55
  - classpath/gson-2.5.jar
56
56
  - classpath/guava-20.0.jar
57
- - classpath/kotlin-stdlib-1.3.0.jar
58
- - classpath/kotlin-stdlib-common-1.3.0.jar
57
+ - classpath/kotlin-stdlib-1.2.60.jar
58
+ - classpath/kotlin-stdlib-common-1.2.60.jar
59
59
  - classpath/okhttp-3.9.1.jar
60
60
  - classpath/okio-2.1.0.jar
61
61
  - config/checkstyle/checkstyle.xml