Skip to content

Commit

Permalink
✨Source Amazon Ads: add report segmet filter (#30517)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazebnyi authored Sep 19, 2023
1 parent fa6ae0f commit 9081608
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]


LABEL io.airbyte.version=3.1.2
LABEL io.airbyte.version=3.2.0
LABEL io.airbyte.name=airbyte/source-amazon-ads
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{"stream":"sponsored_display_product_ads","data":{"adId":103527738992867,"adGroupId":239470166910761,"campaignId":25934734632378,"asin":"B000BNT386","state":"enabled"},"emitted_at":1659020219614}
{"stream":"sponsored_display_product_ads","data":{"adId":195948665185008,"adGroupId":239470166910761,"campaignId":25934734632378,"asin":"B000BNQBOA","state":"enabled"},"emitted_at":1659020219614}
{"stream":"sponsored_display_product_ads","data":{"adId":130802512011075,"adGroupId":239470166910761,"campaignId":25934734632378,"asin":"B091G1HT4P","state":"enabled"},"emitted_at":1659020219614}
{"stream":"sponsored_display_targetings","data":{"adGroupId":239470166910761,"bid":0.4,"expression":[{"type":"similarProduct"}],"expressionType":"auto","resolvedExpression":[{"type":"similarProduct"}],"state":"enabled","targetId":124150067548052},"emitted_at":1659020220625}
{"stream":"sponsored_display_targetings","data":{"adGroupId":239470166910761,"bid":0.4,"expression":[{"type":"similarProduct"}],"expressionType":"auto","resolvedExpression":[{"type":"similarProduct"}],"state":"enabled","targetId":124150067548052,"campaignId": 25934734632378},"emitted_at":1659020220625}
{"stream":"sponsored_product_campaigns","data":{"campaignId":39413387973397,"name":"Test campaging for profileId 1861552880916640","campaignType":"sponsoredProducts","targetingType":"manual","premiumBidAdjustment":true,"dailyBudget":10,"ruleBasedBudget":{"isProcessing":false},"startDate":"20220705","endDate":"20220712","state":"paused","bidding":{"strategy":"legacyForSales","adjustments":[{"predicate":"placementTop","percentage":50}]},"tags":{"PONumber":"examplePONumber","accountManager":"exampleAccountManager"}},"emitted_at":1687524797996}
{"stream":"sponsored_product_campaigns","data":{"campaignId":135264288913079,"name":"Campaign - 7/5/2022 18:14:02","campaignType":"sponsoredProducts","targetingType":"auto","premiumBidAdjustment":false,"dailyBudget":10,"startDate":"20220705","state":"enabled","bidding":{"strategy":"legacyForSales","adjustments":[]},"portfolioId":270076898441727},"emitted_at":1687524798170}
{"stream":"sponsored_product_campaigns","data":{"campaignId":191249325250025,"name":"Campaign - 7/8/2022 13:57:48","campaignType":"sponsoredProducts","targetingType":"auto","premiumBidAdjustment":true,"dailyBudget":50,"ruleBasedBudget":{"isProcessing":false},"startDate":"20220708","state":"enabled","bidding":{"strategy":"legacyForSales","adjustments":[{"predicate":"placementProductPage","percentage":100},{"predicate":"placementTop","percentage":100}]},"portfolioId":253945852845204},"emitted_at":1687524798171}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: c6b0a29e-1da9-4512-9002-7bfd0cba2246
dockerImageTag: 3.1.2
dockerImageTag: 3.2.0
dockerRepository: airbyte/source-amazon-ads
githubIssueLabel: source-amazon-ads
icon: amazonads.svg
Expand All @@ -20,6 +20,13 @@ data:
oss:
enabled: true
releaseStage: generally_available
suggestedStreams:
streams:
- profiles
- sponsored_brands_video_report_stream
- sponsored_display_report_stream
- sponsored_brands_report_stream
- sponsored_products_report_stream
documentationUrl: https://docs.airbyte.com/integrations/sources/amazon-ads
tags:
- language:python
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-amazon-ads/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from setuptools import find_packages, setup

MAIN_REQUIREMENTS = ["airbyte-cdk~=0.16", "requests_oauthlib~=1.3.1", "pendulum~=2.1.2"]
MAIN_REQUIREMENTS = ["airbyte-cdk", "requests_oauthlib~=1.3.1", "pendulum~=2.1.2"]

TEST_REQUIREMENTS = [
"requests-mock~=1.9.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

from typing import Optional

from .common import CatalogModel


class AttributionReportModel(CatalogModel):
date: str
brandName: str
marketplace: str
campaignId: str
campaignId: Optional[str]
productAsin: str
productConversionType: str
advertiserName: str
adGroupId: str
creativeId: str
adGroupId: Optional[str]
creativeId: Optional[str]
productName: str
productCategory: str
productSubcategory: str
productGroup: str
publisher: str
publisher: Optional[str]
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@
#

from decimal import Decimal
from typing import Dict
from typing import Dict, List, Optional

from .common import CatalogModel


class LandingPage(CatalogModel):
pageType: str
url: str


class BidAdjustment(CatalogModel):
bidAdjustmentPredicate: str
bidAdjustmentPercent: int


class Creative(CatalogModel):
brandName: str
brandLogoAssetID: str
brandLogoUrl: str
asins: List[str]
shouldOptimizeAsins: bool


class BrandsCampaign(CatalogModel):
campaignId: Decimal
name: str
Expand All @@ -23,9 +41,14 @@ class BrandsCampaign(CatalogModel):
bidOptimization: bool = None
bidMultiplier: Decimal = None
adFormat: str
bidAdjustments: Optional[List[BidAdjustment]]
creative: Optional[Creative]
landingPage: Optional[LandingPage]
supplySource: Optional[str]


class BrandsAdGroup(CatalogModel):
campaignId: Decimal
adGroupId: Decimal
name: str
bid: int
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class DisplayProductAds(CatalogModel):


class DisplayTargeting(Targeting):
campaignId: Decimal
expression: List[Dict[str, str]]
resolvedExpression: List[Dict[str, str]]

Expand Down Expand Up @@ -72,7 +73,7 @@ class DisplayBudgetRuleDetailsDurationEventTypeRuleDuration(CatalogModel):


class DisplayBudgetRuleDetailsDurationDateRangeTypeRuleDuration(CatalogModel):
endDate: str
endDate: Optional[str]
startDate: str


Expand All @@ -94,7 +95,7 @@ class DisplayBudgetRules(CatalogModel):
ruleId: str
ruleStatus: str
ruleState: str
lastUpdatedDate: Decimal
lastUpdatedDate: Optional[Decimal]
createdDate: Decimal
ruleDetails: DisplayBudgetRuleDetails = None
ruleStatusDetails: Dict[str, str] = None
1 change: 1 addition & 0 deletions docs/integrations/sources/amazon-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Information about expected report generation waiting time you may find [here](ht

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------|
| 3.2.0 | 2023-09-18 | [30517](https://github.com/airbytehq/airbyte/pull/30517) | Add suggested streams; fix unexpected column issue |
| 3.1.2 | 2023-08-16 | [29233](https://github.com/airbytehq/airbyte/pull/29233) | Add filter for Marketplace IDs |
| 3.1.1 | 2023-08-28 | [29900](https://github.com/airbytehq/airbyte/pull/29900) | Add 404 handling for no assotiated with bid ad groups |
| 3.1.0 | 2023-08-08 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Add `T00030` tactic support for `sponsored_display_report_stream` |
Expand Down

0 comments on commit 9081608

Please sign in to comment.