-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement sd report metrics and group sb,sp report metrics
- Loading branch information
1 parent
0c3626a
commit 987c68a
Showing
27 changed files
with
319 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
export * from './sponsored-products-ad-group-report-metrics' | ||
export * from './sponsored-products-asins-report-metrics' | ||
export * from './sponsored-products-campaign-report-metrics' | ||
export * from './sponsored-products-keyword-report-metrics' | ||
export * from './sponsored-products-product-ads-report-metrics' | ||
export * from './sponsored-products-product-targeting-report-metrics' | ||
export * from './sponsored-brands-ad-group-report-metrics' | ||
export * from './sponsored-brands-campaign-report-metrics' | ||
export * from './sponsored-brands-headline-search-report-metrics' | ||
export * from './sponsored-brands-keyword-report-metrics' | ||
export * from './sponsored-brands-search-term-report-metrics' | ||
export * from './sponsored-brands-target-report-metrics' | ||
export * from './sponsored-brands/index' | ||
export * from './sponsored-display/index' | ||
export * from './sponsored-products/index' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from './sponsored-brands-ad-group-report-metrics' | ||
export * from './sponsored-brands-campaign-report-metrics' | ||
export * from './sponsored-brands-headline-search-report-metrics' | ||
export * from './sponsored-brands-keyword-report-metrics' | ||
export * from './sponsored-brands-search-term-report-metrics' | ||
export * from './sponsored-brands-target-report-metrics' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './sponsored-display-ad-group-report-metrics' | ||
export * from './sponsored-display-campaign-report-metrics' | ||
export * from './sponsored-display-common-report-metrics' | ||
export * from './sponsored-display-product-ads-report-metrics' | ||
export * from './sponsored-display-target-report-metrics' |
25 changes: 25 additions & 0 deletions
25
...operations/reports/metrics/sponsored-display/sponsored-display-ad-group-report-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as t from 'io-ts' | ||
import { SponsoredDisplayCommonReportMetrics } from './sponsored-display-common-report-metrics' | ||
|
||
/** | ||
* Metrics specific to remarketing and T00020 tactic ad group. | ||
*/ | ||
export const SponsoredDisplayAdGroupReportMetrics = t.union([ | ||
SponsoredDisplayCommonReportMetrics, | ||
|
||
t.union([ | ||
/** | ||
* The name of the ad group. | ||
*/ | ||
t.literal('adGroupName'), | ||
|
||
/** | ||
* The identifier of the ad group. | ||
*/ | ||
t.literal('adGroupId'), | ||
]), | ||
]) | ||
|
||
export type SponsoredDisplayAdGroupReportMetrics = t.TypeOf< | ||
typeof SponsoredDisplayAdGroupReportMetrics | ||
> |
65 changes: 65 additions & 0 deletions
65
...operations/reports/metrics/sponsored-display/sponsored-display-campaign-report-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import * as t from 'io-ts' | ||
import { SponsoredDisplayCommonReportMetrics } from './sponsored-display-common-report-metrics' | ||
|
||
/** | ||
* These metrics are specific to T00001 tactic campaign reports. | ||
*/ | ||
export const SponsoredDisplayCampaignReportMetrics = t.union([ | ||
SponsoredDisplayCommonReportMetrics, | ||
|
||
t.union([ | ||
/** | ||
* The name of the campaign. | ||
*/ | ||
t.literal('campaignName'), | ||
|
||
/** | ||
* The identifier of the campaign. | ||
*/ | ||
t.literal('campaignId'), | ||
|
||
/** | ||
* The status of the campaign. | ||
*/ | ||
t.literal('campaignStatus'), | ||
|
||
/** | ||
* The currency code associated with the campaign. | ||
*/ | ||
t.literal('currency'), | ||
|
||
/** | ||
* Total number of ad impressions. | ||
*/ | ||
t.literal('impressions'), | ||
|
||
/** | ||
* Total number of ad clicks associated with the campaign. Divide clicks by impressions to calculate click through rate (CTR). | ||
*/ | ||
t.literal('clicks'), | ||
|
||
/** | ||
* The total cost of all ad clicks for the campaign. Divide cost by clicks to calculate average cost per click (CPC). | ||
*/ | ||
t.literal('cost'), | ||
|
||
/** | ||
* Number of attributed detail page views occuring within 14 days of click on an ad. | ||
*/ | ||
t.literal('attributedDPV14d'), | ||
|
||
/** | ||
* Number of attributed units sold occurring within 14 days of click on an ad. | ||
*/ | ||
t.literal('attributedUnitsSold14d'), | ||
|
||
/** | ||
* Aggregate value of attributed sales occurring within 14 days of click on ad. | ||
*/ | ||
t.literal('attributedSales14d'), | ||
]), | ||
]) | ||
|
||
export type SponsoredDisplayCampaignReportMetrics = t.TypeOf< | ||
typeof SponsoredDisplayCampaignReportMetrics | ||
> |
136 changes: 136 additions & 0 deletions
136
src/operations/reports/metrics/sponsored-display/sponsored-display-common-report-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
import * as t from 'io-ts' | ||
|
||
export const SponsoredDisplayCommonReportMetrics = t.union([ | ||
/** | ||
* The name of the campaign. | ||
*/ | ||
t.literal('campaignName'), | ||
|
||
/** | ||
* The identifier of the campaign. | ||
*/ | ||
t.literal('campaignId'), | ||
|
||
/** | ||
* Total number of ad impressions. | ||
*/ | ||
t.literal('impressions'), | ||
|
||
/** | ||
* Total number of ad clicks associated with the campaign. | ||
*/ | ||
t.literal('clicks'), | ||
|
||
/** | ||
* The total cost of all ad clicks for the campaign. Divide cost by clicks to calculate average cost per click (CPC). | ||
*/ | ||
t.literal('cost'), | ||
|
||
/** | ||
* The currency code associated with the campaign. | ||
*/ | ||
t.literal('currency'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 24 hours of ad click. | ||
*/ | ||
t.literal('attributedConversions1d'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 7 days of ad click. | ||
*/ | ||
t.literal('attributedConversions7d'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 14 days of ad click. | ||
*/ | ||
t.literal('attributedConversions14d'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 30 days of ad click. | ||
*/ | ||
t.literal('attributedConversions30d'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 24 hours of ad click, where the SKU of the product advertised and the SKU of the conversion event are equivalent. | ||
*/ | ||
t.literal('attributedConversions1dSameSKU'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 7 days of ad click, where the SKU of the product advertised and the SKU of the conversion event are equivalent. | ||
*/ | ||
t.literal('attributedConversions7dSameSKU'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 14 days of ad click, where the SKU of the product advertised and the SKU of the conversion event are equivalent. | ||
*/ | ||
t.literal('attributedConversions14dSameSKU'), | ||
|
||
/** | ||
* Total number of attributed conversion events occuring within 30 days of ad click, where the SKU of the product advertised and the SKU of the conversion event are equivalent. | ||
*/ | ||
t.literal('attributedConversions30dSameSKU'), | ||
|
||
/** | ||
* Total number of attributed units ordered within 24 hours of ad click. | ||
*/ | ||
t.literal('attributedUnitsOrdered1d'), | ||
|
||
/** | ||
* Total number of attributed units ordered within 7 days of ad click. | ||
*/ | ||
t.literal('attributedUnitsOrdered7d'), | ||
|
||
/** | ||
* Total number of attributed units ordered within 14 days of ad click. | ||
*/ | ||
t.literal('attributedUnitsOrdered14d'), | ||
|
||
/** | ||
* Total number of attributed units ordered within 30 days of ad click. | ||
*/ | ||
t.literal('attributedUnitsOrdered30d'), | ||
|
||
/** | ||
* Total number of attributed sales occuring within 24 hours of ad click. | ||
*/ | ||
t.literal('attributedSales1d'), | ||
|
||
/** | ||
* Total number of attributed sales occuring within 7 days of ad click. | ||
*/ | ||
t.literal('attributedSales7d'), | ||
|
||
/** | ||
* Total number of attributed sales occuring within 14 days of ad click. | ||
*/ | ||
t.literal('attributedSales14d'), | ||
|
||
/** | ||
* Total number of attributed sales occuring within 30 days of ad click. | ||
*/ | ||
t.literal('attributedSales30d'), | ||
|
||
/** | ||
* Aggregate value of all attributed sales occuring within 24 hours of ad click, where the SKU of the product advertised and the SKU of the purchased item are equivalent. | ||
*/ | ||
t.literal('attributedSales1dSameSKU'), | ||
|
||
/** | ||
* Aggregate value of all attributed sales occuring within 7 days of ad click, where the SKU of the product advertised and the SKU of the purchased item are equivalent. | ||
*/ | ||
t.literal('attributedSales7dSameSKU'), | ||
|
||
/** | ||
* Aggregate value of all attributed sales occuring within 14 days of ad click, where the SKU of the product advertised and the SKU of the purchased item are equivalent. | ||
*/ | ||
t.literal('attributedSales14dSameSKU'), | ||
|
||
/** | ||
* Aggregate value of all attributed sales occuring within 30 days of ad click, where the SKU of the product advertised and the SKU of the purchased item are equivalent. | ||
*/ | ||
t.literal('attributedSales30dSameSKU'), | ||
]) | ||
export type SponsoredDisplayCommonReportMetrics = t.TypeOf< | ||
typeof SponsoredDisplayCommonReportMetrics | ||
> |
30 changes: 30 additions & 0 deletions
30
...rations/reports/metrics/sponsored-display/sponsored-display-product-ads-report-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as t from 'io-ts' | ||
import { SponsoredDisplayAdGroupReportMetrics } from './sponsored-display-ad-group-report-metrics' | ||
|
||
/** | ||
* Metrics specific to remarketing and T00020 tactic product ad. | ||
*/ | ||
export const SponsoredDisplayProductAdsReportMetrics = t.union([ | ||
SponsoredDisplayAdGroupReportMetrics, | ||
|
||
t.union([ | ||
/** | ||
* The ASIN of the product. | ||
*/ | ||
t.literal('asin'), | ||
|
||
/** | ||
* The SKU of the product. | ||
*/ | ||
t.literal('sku'), | ||
|
||
/** | ||
* The unique numerical ID of the ad. | ||
*/ | ||
t.literal('adId'), | ||
]), | ||
]) | ||
|
||
export type SponsoredDisplayProductAdsReportMetrics = t.TypeOf< | ||
typeof SponsoredDisplayProductAdsReportMetrics | ||
> |
37 changes: 37 additions & 0 deletions
37
src/operations/reports/metrics/sponsored-display/sponsored-display-target-report-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as t from 'io-ts' | ||
import { SponsoredDisplayCommonReportMetrics } from './sponsored-display-common-report-metrics' | ||
|
||
/** | ||
* These metrics are specific to T00020 tactic targeting reports: | ||
*/ | ||
export const SponsoredDisplayTargetReportMetrics = t.union([ | ||
SponsoredDisplayCommonReportMetrics, | ||
|
||
t.union([ | ||
/** | ||
* The identifier of the targeting expression used in a bid. | ||
*/ | ||
t.literal('targetId'), | ||
|
||
/** | ||
* The string representation of your expression object in targeting clauses. | ||
*/ | ||
t.literal('targetingExpression'), | ||
|
||
/** | ||
* The resolved string representation of your expression object in targeting clauses. | ||
*/ | ||
t.literal('targetingText'), | ||
|
||
/** | ||
* The type of match for the targeting expression used in bid. | ||
* For manually created expressions, this value is TARGETING_EXPRESSION. | ||
* For auto-targeting expressions this value is TARGETING_EXPRESSION_PREDEFINED. | ||
*/ | ||
t.literal('targetingType'), | ||
]), | ||
]) | ||
|
||
export type SponsoredDisplayTargetReportMetrics = t.TypeOf< | ||
typeof SponsoredDisplayTargetReportMetrics | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from './sponsored-products-ad-group-report-metrics' | ||
export * from './sponsored-products-asins-report-metrics' | ||
export * from './sponsored-products-campaign-report-metrics' | ||
export * from './sponsored-products-keyword-report-metrics' | ||
export * from './sponsored-products-product-ads-report-metrics' | ||
export * from './sponsored-products-product-targeting-report-metrics' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/operations/reports/sponsored-products/sponsored-products-ad-group-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/operations/reports/sponsored-products/sponsored-products-asins-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/operations/reports/sponsored-products/sponsored-products-campaign-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/operations/reports/sponsored-products/sponsored-products-keyword-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/operations/reports/sponsored-products/sponsored-products-product-ads-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/operations/reports/sponsored-products/sponsored-products-targets-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters