Skip to content

Commit

Permalink
Merge pull request #5 from vtex-apps/feat/sponsored-banners
Browse files Browse the repository at this point in the history
Feat: sponsored banners
  • Loading branch information
luarakerlen authored Nov 1, 2024
2 parents 001c4ad + 459d859 commit 1bbfdbd
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- `sponsoredBanners` query.
- `SponsoredBanner` type.
- `AdvertisementBanner` type.

## [0.3.0] - 2024-07-08

### Added
Expand Down
22 changes: 22 additions & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,26 @@ type Query {
"""
sponsoredCount: Int
): [SponsoredProduct] @cacheControl(scope: PUBLIC, maxAge: SHORT)
sponsoredBanners(
"""
Maximum number of sponsored banners that should be returned.
"""
sponsoredCount: Int
"""
Placement of the banner. Used for analytics purposes.
"""
placement: Placement
"""
Banner dimensions.
"""
adUnit: AdUnit
"""
Channel where the banner is being shown. Used for analytics purposes.
"""
channel: Channel
"""
Identifier for users, logged in or not. Used for A/B tests.
"""
anonymousId: String
): [SponsoredBanner] @cacheControl(scope: PUBLIC, maxAge: SHORT)
}
14 changes: 14 additions & 0 deletions graphql/types/AdUnit.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
enum AdUnit {
billboard
smartphonebanner
leaderboard
superleaderboard
portrait
skyscraper
mediumrectangle
button120x60
mobilephoneinterstitial
featurephonesmallbanner
featurephonemediumbanner
featurephonelargebanner
}
7 changes: 7 additions & 0 deletions graphql/types/Channel.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
enum Channel {
website
android
ios
msite
whatsapp
}
10 changes: 10 additions & 0 deletions graphql/types/Placement.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
enum Placement {
top_search
middle_search
home_shelfpdp_shelf
search_shelf
cart_shelf
plp_shelf
autocomplete
homepage
}
33 changes: 33 additions & 0 deletions graphql/types/SponsoredBanner.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type SponsoredBanner {
"""
ID of the sponsored banner.
"""
adResponseId: ID
"""
Sponsored campaign related information should be added here.
"""
advertisement: AdvertisementBanner
}

type AdvertisementBanner {
"""
Banner Image ID.
"""
bannerImageId: ID
"""
URL of the image to be displayed in the ad.
"""
imageUrl: String
"""
URL to be redirected to when the ad is clicked.
"""
targetUrl: String
"""
Width of the banner in pixels.
"""
width: Int
"""
Height of the banner in pixels.
"""
height: Int
}

0 comments on commit 1bbfdbd

Please sign in to comment.