From 150e3c8057f6a0d342144a6767af38567187604e Mon Sep 17 00:00:00 2001 From: takeshi fujita Date: Wed, 25 Nov 2020 17:15:16 +0900 Subject: [PATCH 1/3] fix fields --- .../AdsInsightsAccessor.java | 54 ++++--------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/src/main/java/org/embulk/input/facebook_ads_insights/AdsInsightsAccessor.java b/src/main/java/org/embulk/input/facebook_ads_insights/AdsInsightsAccessor.java index 40e1a61..5ebd695 100644 --- a/src/main/java/org/embulk/input/facebook_ads_insights/AdsInsightsAccessor.java +++ b/src/main/java/org/embulk/input/facebook_ads_insights/AdsInsightsAccessor.java @@ -29,72 +29,45 @@ public String get(String name) case "account_name": return adsInsights.getFieldAccountName(); case "action_values": return actionsToString(adsInsights.getFieldActionValues()); case "actions": return actionsToString(adsInsights.getFieldActions()); - case "ad_bid_type": return adsInsights.getFieldAdBidType(); - case "ad_bid_value": return adsInsights.getFieldAdBidValue(); - case "ad_click_actions": return actionsToString(adsInsights.getFieldAdClickActions()); - case "ad_delivery": return adsInsights.getFieldAdDelivery(); case "ad_id": return adsInsights.getFieldAdId(); - case "ad_impression_actions": return actionsToString(adsInsights.getFieldAdImpressionActions()); case "ad_name": return adsInsights.getFieldAdName(); - case "adset_bid_type": return adsInsights.getFieldAdsetBidType(); - case "adset_bid_value": return adsInsights.getFieldAdsetBidValue(); - case "adset_budget_type": return adsInsights.getFieldAdsetBudgetType(); - case "adset_budget_value": return adsInsights.getFieldAdsetBudgetValue(); - case "adset_delivery": return adsInsights.getFieldAdsetDelivery(); - case "adset_end": return adsInsights.getFieldAdsetEnd(); case "adset_id": return adsInsights.getFieldAdsetId(); case "adset_name": return adsInsights.getFieldAdsetName(); - case "adset_start": return adsInsights.getFieldAdsetStart(); - case "age_targeting": return adsInsights.getFieldAgeTargeting(); - case "auction_bid": return adsInsights.getFieldAuctionBid(); - case "auction_competitiveness": return adsInsights.getFieldAuctionCompetitiveness(); - case "auction_max_competitor_bid": return adsInsights.getFieldAuctionMaxCompetitorBid(); case "buying_type": return adsInsights.getFieldBuyingType(); case "campaign_id": return adsInsights.getFieldCampaignId(); case "campaign_name": return adsInsights.getFieldCampaignName(); case "canvas_avg_view_percent": return adsInsights.getFieldCanvasAvgViewPercent(); case "canvas_avg_view_time": return adsInsights.getFieldCanvasAvgViewTime(); + case "catalog_segment_value": return actionsToString(adsInsights.getFieldCatalogSegmentValue()); case "clicks": return adsInsights.getFieldClicks(); case "conversion_rate_ranking": return adsInsights.getFieldConversionRateRanking(); case "conversion_values": return actionsToString(adsInsights.getFieldConversionValues()); case "conversions": return actionsToString(adsInsights.getFieldConversions()); - case "cost_per_15_sec_video_view": return actionsToString(adsInsights.getFieldCostPer15SecVideoView()); - case "cost_per_2_sec_continuous_video_view": return actionsToString(adsInsights.getFieldCostPer2SecContinuousVideoView()); + case "converted_product_quantity": return actionsToString(adsInsights.getFieldConvertedProductQuantity()); + case "converted_product_value": return actionsToString(adsInsights.getFieldConvertedProductValue()); case "cost_per_action_type": return actionsToString(adsInsights.getFieldCostPerActionType()); - case "cost_per_ad_click": return actionsToString(adsInsights.getFieldCostPerAdClick()); case "cost_per_conversion": return actionsToString(adsInsights.getFieldCostPerConversion()); - case "cost_per_dda_countby_convs": return adsInsights.getFieldCostPerDdaCountbyConvs(); case "cost_per_estimated_ad_recallers": return adsInsights.getFieldCostPerEstimatedAdRecallers(); case "cost_per_inline_link_click": return adsInsights.getFieldCostPerInlineLinkClick(); case "cost_per_inline_post_engagement": return adsInsights.getFieldCostPerInlinePostEngagement(); - case "cost_per_one_thousand_ad_impression": return actionsToString(adsInsights.getFieldCostPerOneThousandAdImpression()); case "cost_per_outbound_click": return actionsToString(adsInsights.getFieldCostPerOutboundClick()); - case "cost_per_store_visit_action": return actionsToString(adsInsights.getFieldCostPerStoreVisitAction()); case "cost_per_thruplay": return actionsToString(adsInsights.getFieldCostPerThruplay()); case "cost_per_unique_action_type": return actionsToString(adsInsights.getFieldCostPerUniqueActionType()); case "cost_per_unique_click": return adsInsights.getFieldCostPerUniqueClick(); - case "cost_per_unique_conversion": return actionsToString(adsInsights.getFieldCostPerUniqueConversion()); case "cost_per_unique_inline_link_click": return adsInsights.getFieldCostPerUniqueInlineLinkClick(); case "cost_per_unique_outbound_click": return actionsToString(adsInsights.getFieldCostPerUniqueOutboundClick()); case "cpc": return adsInsights.getFieldCpc(); case "cpm": return adsInsights.getFieldCpm(); case "cpp": return adsInsights.getFieldCpp(); - case "created_time": return adsInsights.getFieldCreatedTime(); case "ctr": return adsInsights.getFieldCtr(); case "date_start": return adsInsights.getFieldDateStart(); case "date_stop": return adsInsights.getFieldDateStop(); - case "dda_countby_convs": return adsInsights.getFieldDdaCountbyConvs(); case "engagement_rate_ranking": return adsInsights.getFieldEngagementRateRanking(); case "estimated_ad_recall_rate": return adsInsights.getFieldEstimatedAdRecallRate(); - case "estimated_ad_recall_rate_lower_bound": return adsInsights.getFieldEstimatedAdRecallRateLowerBound(); - case "estimated_ad_recall_rate_upper_bound": return adsInsights.getFieldEstimatedAdRecallRateUpperBound(); case "estimated_ad_recallers": return adsInsights.getFieldEstimatedAdRecallers(); - case "estimated_ad_recallers_lower_bound": return adsInsights.getFieldEstimatedAdRecallersLowerBound(); - case "estimated_ad_recallers_upper_bound": return adsInsights.getFieldEstimatedAdRecallersUpperBound(); case "frequency": return adsInsights.getFieldFrequency(); case "full_view_impressions": return adsInsights.getFieldFullViewImpressions(); case "full_view_reach": return adsInsights.getFieldFullViewReach(); - case "gender_targeting": return adsInsights.getFieldGenderTargeting(); case "impressions": return adsInsights.getFieldImpressions(); case "inline_link_click_ctr": return adsInsights.getFieldInlineLinkClickCtr(); case "inline_link_clicks": return adsInsights.getFieldInlineLinkClicks(); @@ -102,49 +75,36 @@ public String get(String name) case "instant_experience_clicks_to_open": return adsInsights.getFieldInstantExperienceClicksToOpen(); case "instant_experience_clicks_to_start": return adsInsights.getFieldInstantExperienceClicksToStart(); case "instant_experience_outbound_clicks": return adsInsights.getFieldInstantExperienceOutboundClicks(); - case "labels": return adsInsights.getFieldLabels(); - case "location": return adsInsights.getFieldLocation(); case "mobile_app_purchase_roas": return actionsToString(adsInsights.getFieldMobileAppPurchaseRoas()); case "objective": return adsInsights.getFieldObjective(); case "outbound_clicks": return actionsToString(adsInsights.getFieldOutboundClicks()); case "outbound_clicks_ctr": return actionsToString(adsInsights.getFieldOutboundClicksCtr()); case "place_page_name": return adsInsights.getFieldPlacePageName(); case "purchase_roas": return actionsToString(adsInsights.getFieldPurchaseRoas()); + case "qualifying_question_qualify_answer_rate": return adsInsights.getFieldQualifyingQuestionQualifyAnswerRate(); case "quality_ranking": return adsInsights.getFieldQualityRanking(); - case "quality_score_ectr": return adsInsights.getFieldQualityScoreEctr(); - case "quality_score_ecvr": return adsInsights.getFieldQualityScoreEcvr(); - case "quality_score_organic": return adsInsights.getFieldQualityScoreOrganic(); case "reach": return adsInsights.getFieldReach(); case "social_spend": return adsInsights.getFieldSocialSpend(); case "spend": return adsInsights.getFieldSpend(); - case "store_visit_actions": return actionsToString(adsInsights.getFieldStoreVisitActions()); case "unique_actions": return actionsToString(adsInsights.getFieldUniqueActions()); case "unique_clicks": return adsInsights.getFieldUniqueClicks(); - case "unique_conversions": return actionsToString(adsInsights.getFieldUniqueConversions()); case "unique_ctr": return adsInsights.getFieldUniqueCtr(); case "unique_inline_link_click_ctr": return adsInsights.getFieldUniqueInlineLinkClickCtr(); case "unique_inline_link_clicks": return adsInsights.getFieldUniqueInlineLinkClicks(); case "unique_link_clicks_ctr": return adsInsights.getFieldUniqueLinkClicksCtr(); case "unique_outbound_clicks": return actionsToString(adsInsights.getFieldUniqueOutboundClicks()); case "unique_outbound_clicks_ctr": return actionsToString(adsInsights.getFieldUniqueOutboundClicksCtr()); - case "unique_video_continuous_2_sec_watched_actions": return actionsToString(adsInsights.getFieldUniqueVideoContinuous2SecWatchedActions()); - case "unique_video_view_15_sec": return actionsToString(adsInsights.getFieldUniqueVideoView15Sec()); - case "updated_time": return adsInsights.getFieldUpdatedTime(); - case "video_15_sec_watched_actions": return actionsToString(adsInsights.getFieldVideo15SecWatchedActions()); case "video_30_sec_watched_actions": return actionsToString(adsInsights.getFieldVideo30SecWatchedActions()); case "video_avg_time_watched_actions": return actionsToString(adsInsights.getFieldVideoAvgTimeWatchedActions()); - case "video_continuous_2_sec_watched_actions": return actionsToString(adsInsights.getFieldVideoContinuous2SecWatchedActions()); case "video_p100_watched_actions": return actionsToString(adsInsights.getFieldVideoP100WatchedActions()); case "video_p25_watched_actions": return actionsToString(adsInsights.getFieldVideoP25WatchedActions()); case "video_p50_watched_actions": return actionsToString(adsInsights.getFieldVideoP50WatchedActions()); case "video_p75_watched_actions": return actionsToString(adsInsights.getFieldVideoP75WatchedActions()); case "video_p95_watched_actions": return actionsToString(adsInsights.getFieldVideoP95WatchedActions()); case "video_play_actions": return actionsToString(adsInsights.getFieldVideoPlayActions()); - case "video_thruplay_watched_actions": return actionsToString(adsInsights.getFieldVideoThruplayWatchedActions()); - case "video_time_watched_actions": return actionsToString(adsInsights.getFieldVideoTimeWatchedActions()); + case "video_play_curve_actions": return objectsToString(adsInsights.getFieldVideoPlayCurveActions()); case "website_ctr": return actionsToString(adsInsights.getFieldWebsiteCtr()); case "website_purchase_roas": return actionsToString(adsInsights.getFieldWebsitePurchaseRoas()); - case "wish_bid": return adsInsights.getFieldWishBid(); // breakdowns case "ad_format_asset": return extractBreakdown("ad_format_asset"); case "age": return extractBreakdown("age"); @@ -176,6 +136,10 @@ private String actionsToString(List actions) { return Objects.isNull(actions) ? "[]" : "[" + actions.stream().map(AdsActionStats::toString).collect(Collectors.joining(",")) + "]"; } + private String objectsToString(List objects) + { + return Objects.isNull(objects) ? "[]" : "[" + objects.stream().map(Object::toString).collect(Collectors.joining(",")) + "]"; + } private String extractBreakdown(String name) { JsonElement data = this.adsInsights.getRawResponseAsJsonObject().get(name); From 677706174f807a818da4a041885ea09db5d4d1ee Mon Sep 17 00:00:00 2001 From: takeshi fujita Date: Wed, 25 Nov 2020 17:16:39 +0900 Subject: [PATCH 2/3] update plugin version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 53f156b..cf599d5 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ configurations { provided } -version = "0.1.6" +version = "0.1.7" sourceCompatibility = 1.8 targetCompatibility = 1.8 From 1aa75cb2e271ad9b52895b8f02097b97caab6b10 Mon Sep 17 00:00:00 2001 From: takeshi fujita Date: Thu, 26 Nov 2020 11:46:06 +0900 Subject: [PATCH 3/3] modify plugin version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index cf599d5..961275a 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ configurations { provided } -version = "0.1.7" +version = "0.1.8" sourceCompatibility = 1.8 targetCompatibility = 1.8