Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add missing metrics and report type to sd report #771

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/operations/reports/metrics/sponsored-display/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './sponsored-display-ad-group-report-metrics'
export * from './sponsored-display-asin-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'
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
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'),
]),
t.literal('campaignName'),
t.literal('campaignId'),
t.literal('adGroupName'),
t.literal('adGroupId'),
t.literal('impressions'),
t.literal('clicks'),
t.literal('cost'),
t.literal('currency'),
t.literal('attributedConversions1d'),
t.literal('attributedConversions7d'),
t.literal('attributedConversions14d'),
t.literal('attributedConversions30d'),
t.literal('attributedConversions1dSameSKU'),
t.literal('attributedConversions7dSameSKU'),
t.literal('attributedConversions14dSameSKU'),
t.literal('attributedConversions30dSameSKU'),
t.literal('attributedUnitsOrdered1d'),
t.literal('attributedUnitsOrdered7d'),
t.literal('attributedUnitsOrdered14d'),
t.literal('attributedUnitsOrdered30d'),
t.literal('attributedSales1d'),
t.literal('attributedSales7d'),
t.literal('attributedSales14d'),
t.literal('attributedSales30d'),
t.literal('attributedSales1dSameSKU'),
t.literal('attributedSales7dSameSKU'),
t.literal('attributedSales14dSameSKU'),
t.literal('attributedSales30dSameSKU'),
t.literal('attributedOrdersNewToBrand14d'),
t.literal('attributedSalesNewToBrand14d'),
t.literal('attributedUnitsOrderedNewToBrand14d'),
])

export type SponsoredDisplayAdGroupReportMetrics = t.TypeOf<
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as t from 'io-ts'

/**
* Metrics specific to remarketing and T00020 tactic ad group.
*/
export const SponsoredDisplayAsinReportMetrics = t.union([
t.literal('campaignName'),
t.literal('campaignId'),
t.literal('adGroupName'),
t.literal('adGroupId'),
t.literal('asin'),
t.literal('otherAsin'),
t.literal('sku'),
t.literal('currency'),
t.literal('attributedUnitsOrdered1dOtherSKU'),
t.literal('attributedUnitsOrdered7dOtherSKU'),
t.literal('attributedUnitsOrdered14dOtherSKU'),
t.literal('attributedUnitsOrdered30dOtherSKU'),
t.literal('attributedSales1dOtherSKU'),
t.literal('attributedSales7dOtherSKU'),
t.literal('attributedSales14dOtherSKU'),
t.literal('attributedSales30dOtherSKU'),
])

export type SponsoredDisplayAsinReportMetrics = t.TypeOf<typeof SponsoredDisplayAsinReportMetrics>
Original file line number Diff line number Diff line change
@@ -1,63 +1,41 @@
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'),
]),
t.literal('campaignName'),
t.literal('campaignId'),
t.literal('campaignStatus'),
t.literal('impressions'),
t.literal('clicks'),
t.literal('cost'),
t.literal('currency'),
t.literal('attributedConversions1d'),
t.literal('attributedConversions7d'),
t.literal('attributedConversions14d'),
t.literal('attributedConversions30d'),
t.literal('attributedConversions1dSameSKU'),
t.literal('attributedConversions7dSameSKU'),
t.literal('attributedConversions14dSameSKU'),
t.literal('attributedConversions30dSameSKU'),
t.literal('attributedUnitsOrdered1d'),
t.literal('attributedUnitsOrdered7d'),
t.literal('attributedUnitsOrdered14d'),
t.literal('attributedUnitsOrdered30d'),
t.literal('attributedSales1d'),
t.literal('attributedSales7d'),
t.literal('attributedSales14d'),
t.literal('attributedSales30d'),
t.literal('attributedSales1dSameSKU'),
t.literal('attributedSales7dSameSKU'),
t.literal('attributedSales14dSameSKU'),
t.literal('attributedSales30dSameSKU'),
t.literal('attributedOrdersNewToBrand14d'),
t.literal('attributedSalesNewToBrand14d'),
t.literal('attributedUnitsOrderedNewToBrand14d'),
t.literal('attributedDPV14d'),
t.literal('attributedUnitsSold14d'),
])

export type SponsoredDisplayCampaignReportMetrics = t.TypeOf<
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
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'),
]),
t.literal('campaignName'),
t.literal('campaignId'),
t.literal('adGroupName'),
t.literal('adGroupId'),
t.literal('asin'),
t.literal('sku'),
t.literal('adId'),
t.literal('impressions'),
t.literal('clicks'),
t.literal('cost'),
t.literal('currency'),
t.literal('attributedConversions1d'),
t.literal('attributedConversions7d'),
t.literal('attributedConversions14d'),
t.literal('attributedConversions30d'),
t.literal('attributedConversions1dSameSKU'),
t.literal('attributedConversions7dSameSKU'),
t.literal('attributedConversions14dSameSKU'),
t.literal('attributedConversions30dSameSKU'),
t.literal('attributedUnitsOrdered1d'),
t.literal('attributedUnitsOrdered7d'),
t.literal('attributedUnitsOrdered14d'),
t.literal('attributedUnitsOrdered30d'),
t.literal('attributedSales1d'),
t.literal('attributedSales7d'),
t.literal('attributedSales14d'),
t.literal('attributedSales30d'),
t.literal('attributedSales1dSameSKU'),
t.literal('attributedSales7dSameSKU'),
t.literal('attributedSales14dSameSKU'),
t.literal('attributedSales30dSameSKU'),
t.literal('attributedOrdersNewToBrand14d'),
t.literal('attributedSalesNewToBrand14d'),
t.literal('attributedUnitsOrderedNewToBrand14d'),
])

export type SponsoredDisplayProductAdsReportMetrics = t.TypeOf<
Expand Down
Loading