[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides vtex io documentation 9 improving performance with caching in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/updates/release-notes)

App Development

[What is VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-what-is-vtex-io)

---

[What is a VTEX App](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-what-is-a-vtex-app)

---

[Governance and shared security in VTEX IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/governance-and-shared-security-in-vtex-io-apps)

---

[Code samples and templates](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/code-samples)

---

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-getting-started)

[Storefront apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-1-developing-storefront-apps-using-react-and-vtex-io)

[1\. Setting up your development environment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-2-basic-development-setup-in-vtex-io)

[2\. Creating the new app](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-3-creating-the-new-app)

[3\. Declaring a theme block](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-4-declaring-a-theme-block)

[4\. Defining styles](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-5-defining-styles)

[5\. Structuring documentation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-6-structuring-documentation)

[6\. Consuming data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-7-consuming-data)

[7\. Translating the component](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-8-translating-the-component)

[8\. Improving performance with caching](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-9-improving-performance-with-caching)

[9\. Making your app publicly available](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-10-making-your-app-publicly-available)

[Best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-developing-custom-storefront-components)

[Pixel apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-1-developnativeintegrationswithpixelapps)

[Master Data CRUD](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/create-master-data-crud-app)

---

Project structure

---

[VTEX IO CLI](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-vtex-io-cli-installation-and-command-reference)

---

[Workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-workspace)

---

Managing apps

---

Development guides

---

[Node apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/app-development-guides)

---

[GraphQL in VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/graphql-in-vtex-io)

---

[Policies and permissions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-policies)

---

[A/B tests](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/ab-tests)

---

[Deployment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-making-your-new-app-version-publicly-available)

---

[VTEX App Store](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-app-store)

---

[Edition Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/managing-edition-apps)

---

[Frequently asked questions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-frequently-asked-questions)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/updates/release-notes)

App Development

[What is VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-what-is-vtex-io)

---

[What is a VTEX App](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-what-is-a-vtex-app)

---

[Governance and shared security in VTEX IO apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/governance-and-shared-security-in-vtex-io-apps)

---

[Code samples and templates](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/code-samples)

---

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-getting-started)

[Storefront apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-1-developing-storefront-apps-using-react-and-vtex-io)

[1\. Setting up your development environment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-2-basic-development-setup-in-vtex-io)

[2\. Creating the new app](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-3-creating-the-new-app)

[3\. Declaring a theme block](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-4-declaring-a-theme-block)

[4\. Defining styles](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-5-defining-styles)

[5\. Structuring documentation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-6-structuring-documentation)

[6\. Consuming data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-7-consuming-data)

[7\. Translating the component](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-8-translating-the-component)

[8\. Improving performance with caching](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-9-improving-performance-with-caching)

[9\. Making your app publicly available](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-10-making-your-app-publicly-available)

[Best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-developing-custom-storefront-components)

[Pixel apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-1-developnativeintegrationswithpixelapps)

[Master Data CRUD](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/create-master-data-crud-app)

---

Project structure

---

[VTEX IO CLI](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-vtex-io-cli-installation-and-command-reference)

---

[Workspace](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-workspace)

---

Managing apps

---

Development guides

---

[Node apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/app-development-guides)

---

[GraphQL in VTEX IO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/graphql-in-vtex-io)

---

[Policies and permissions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-policies)

---

[A/B tests](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/ab-tests)

---

[Deployment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-making-your-new-app-version-publicly-available)

---

[VTEX App Store](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-app-store)

---

[Edition Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/managing-edition-apps)

---

[Frequently asked questions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-frequently-asked-questions)

---

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/app-development)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-getting-started)

[Storefront apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-1-developing-storefront-apps-using-react-and-vtex-io)

[8\. Improving performance with caching](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-9-improving-performance-with-caching)

8\. Improving performance with caching

Repeated searches for similar data can become an expensive and frustrating investment as they require a high number of responses from the server to deliver the requested information.

That is why the **ability to use _cache_ and reuse data previously obtained on the server can be a critical point for optimizing your front app's performance and, consequently, your website**.

The VTEX IO development platform already applies advanced _cache_ techniques to the [Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/getting-started-3) using the Apollo _cache_ as a search and data management solution capable of interacting with VTEX's GraphQL services.

We highly recommended using the [Apollo solution](https://read.calvincode.net/reader?url=https://www.apollographql.com/docs/react/caching/cache-configuration/) in your app and, that way, define your own _cache_ strategies that mold to the business scenario that applies to your store.

![{"base64":"  ","img":{"width":1400,"height":1400,"type":"jpg","mime":"image/jpeg","wUnits":"px","hUnits":"px","length":131399,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-9-improving-performance-with-caching-0.jpeg"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-9-improving-performance-with-caching-0.jpeg)

Once implemented, the solution operates without major configurations: two GraphQL _requests_ with the same _query_ and variables reach the server only once for data collection.

You can read about [Apollo usage rules and policies](https://read.calvincode.net/reader?url=https://medium.com/@galen.corey/understanding-apollo-fetch-policies-705b5ad71980) to understand more about possible data collection scenarios using this solution.

For example, if you use the `cache-and-network` rule, you will be able to immediately return the requested data if it is _cached_ and still query the server to confirm if any data has been changed since then.

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/vtex-io/Getting-Started/vtex-io-documentation-1-developing-storefront-apps-using-react-and-vtex-io/vtex-io-documentation-9-improving-performance-with-caching.md)

[7\. Translating the component« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching//docs/guides/vtex-io-documentation-8-translating-the-component)[9\. Making your app publicly availableNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching//docs/guides/vtex-io-documentation-10-making-your-app-publicly-available)

See also

[9\. Making your app publicly availableApp Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/docs/guides/vtex-io-documentation-10-making-your-app-publicly-available)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-io-documentation-9-improving-performance-with-caching/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/vtex-io/Getting-Started/vtex-io-documentation-1-developing-storefront-apps-using-react-and-vtex-io/vtex-io-documentation-9-improving-performance-with-caching.md)

Copy page

On this page

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides creating and managing coupons with promotions api in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/updates/release-notes)

Guides

[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/vtex-platform-overview)

---

[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/api-usage)

---

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/getting-started)

---

Integration Guides

---

[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/catalog-integration)

---

[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/checkout-api-overview)

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/master-data)

---

Payments

---

Orders

---

Logistics

---

B2B Suite

---

VTEX Sales App

---

UI Customization

---

Message Center

---

Pricing

---

Promotions

[Creating and managing coupons with Promotions API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api)

[Using Policy Engine API on Promotion Alerts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/using-policy-engine-api-on-promotion-alerts)

[Seller Opt-in Promotions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/seller-opt-in-promotions)

---

Infrastructure

---

Search

---

Storefront Permissions

---

[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/activity-flow)

---

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/vtex-ads)

---

VTEX Session

---

VTEX Shield

---

[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/data-protection-plus)

---

Weni by VTEX

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/updates/release-notes)

Guides

[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/vtex-platform-overview)

---

[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/api-usage)

---

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/getting-started)

---

Integration Guides

---

[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/catalog-integration)

---

[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/checkout-api-overview)

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/master-data)

---

Payments

---

Orders

---

Logistics

---

B2B Suite

---

VTEX Sales App

---

UI Customization

---

Message Center

---

Pricing

---

Promotions

[Creating and managing coupons with Promotions API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api)

[Using Policy Engine API on Promotion Alerts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/using-policy-engine-api-on-promotion-alerts)

[Seller Opt-in Promotions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/seller-opt-in-promotions)

---

Infrastructure

---

Search

---

Storefront Permissions

---

[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/activity-flow)

---

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/vtex-ads)

---

VTEX Session

---

VTEX Shield

---

[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/data-protection-plus)

---

Weni by VTEX

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides)

Promotions

[Creating and managing coupons with Promotions API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api)

Creating and managing coupons with Promotions API

A coupon is a code that when entered in the cart grants the customer a discount on the price of purchase for a determined product.

To make a coupon available for use you need to associate the coupon to a **Promotion**.

A single coupon can be associated with one or more promotions by filling the `utmSource` or `utmCampain` fields with the same values for both coupon and promotion configuration.

> Coupons cannot be deleted, only archived. It is important to emphasize that you can only archive one coupon at a time. You can edit and reuse a coupon, but the `coupon code` can not be modified.

## Restrictions

There’s a quantity limit to the active coupons. We recommend reusing coupons because a high number of coupons can compromise the Promotions & Taxes performance.

## How to create a coupon

You can create one coupon or multiple coupons at a time.

* To create a single coupon, use the POST [Create coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/coupon/) endpoint.
* If you want to create multiple coupons use the POST [Create multiple coupons](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/multiple-coupons) endpoint.

> If you try to create a coupon with an existing `coupon code`, the API will update the existing coupon.

## How to edit a coupon

Coupons can be edited and reused as you wish. However, the `coupon code` cannot be modified.

> There is a limited quantity of active coupons. Coupon reuse is highly recommended since a high number of coupons may compromise the Promotions & Taxes performance.

## How to archive a coupon

As said before, you can only archive one coupon at a time. You must use the POST [Archive coupon by coupon code](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/archive/coupon/-couponCode-) endpoint to do so.

## Examples of usage

### Creating 50 coupons

To create 50 different coupons with `coupon codes` randomly generated, you must use the [Create multiple coupons](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/multiple-coupons) endpoint with `quantity` set to `50`.

If you want to define the `coupon codes`, you can use this route as well, setting the `coupon codes` params with the desired values and `quantity` as `1` for each `coupon configuration`, as the example below.

`1

[

2

 {

3

 "quantity": 1,

4

 "couponConfiguration": {

5

 "utmSource": "cupom1",

6

 "utmCampaign": null,

7

 "couponCode": "test1",

8

 "isArchived": false,

9

 "maxItemsPerClient": 10,

10

 "expirationIntervalPerUse": "00:00:00"

11

 }

12

 },

13

 {

14

 "quantity": 1,

15

 "couponConfiguration": {

16

 "utmSource": "cupom2",

17

 "utmCampaign": null,

18

 "couponCode": "test2",

19

 "isArchived": false,

20

 "maxItemsPerClient": 5,

21

 "expirationIntervalPerUse": "00:10:00"

22

 }

23

 }

24

]

`

You can associate these 50 coupons to a single promotion by repeating the same `utmSource` or `utmCampaign` in all of them, and then linking that UTM tag to the promotion. This can be done for any number of coupons.

To create or update a promotion, check the post [Create Or Update Promotion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/calculatorconfiguration) endpoint.

### Creating single-use coupon and promotion

Sandy is a frequent client of your store and it is her birthday. You can use the [Create coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/coupon/) endpoint with the `coupon code` set to `Birthday123`, associate it to a promotion then, send it to her.

To enable the single-use of a coupon, you must restrict the promotion to a single-use as well so she use the `Birthday123` code on her checkout for only one purchase. To do so, follow the steps bellow:

1. In the Admin, select the **Promotions & Taxes** module.
2. Click on **Promotions**.
3. Click on the **New Promotion** \> **Regular** button.
4. Check the selection box of `utm_source` and add the `Birthday123` code to the field.
![{"base64":"  ","img":{"width":637,"height":381,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":18456,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/creating-and-managing-coupons-with-promotions-api-0.png"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/creating-and-managing-coupons-with-promotions-api-0.png)
5. Uncheck the unlimited selection boxes from the **How many times will your promotion be applied in your store** and **How many times will your promotion be applied in your store per client fields**.
6. Add the number one to each field to enable the single-use promotion.
![{"base64":"  ","img":{"width":638,"height":254,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":20629,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/creating-and-managing-coupons-with-promotions-api-1.png"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/creating-and-managing-coupons-with-promotions-api-1.png)
7. Click on **Save**.

### Coupon massive generation

To create a large number of coupons with the same settings, you can use the [Coupon Massive Generation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/promotions-and-taxes-api%23post-/api/rnb/pvt/coupons) endpoint. This endpoint will generate the determined quantity of coupons differing only their names through automatic generation.

First, set the query param `quantity` to `10`, for example. Then, make the following request body:

`1

{

2

 "utmSource": "cupom",

3

 "utmCampaign": null,

4

 "couponCode": "ctest",

5

 "isArchived": false,

6

 "maxItemsPerClient": 1,

7

 "expirationIntervalPerUse": "00:00:00"

8

}

`

The result for the request will be the creation of ten coupons with the same settings and the following response body:

`1

[

2

 "ctest-wzcp5lwt7yz1s7n",

3

 "ctest-rb6smoassp2xe71",

4

 "ctest-vpw84ag9tfi8khv",

5

 "ctest-ne26wgmidp5ctht",

6

 "ctest-127ng0ox09tho5l",

7

 "ctest-qsowch8c8s7jipo",

8

 "ctest-6acbsst6zpss75l",

9

 "ctest-0bksc2tzh5ai946",

10

 "ctest-4jjx8u2rrqj4ck9",

11

 "ctest-hxiox1isdp6padl"

12

]

`

Contributors

2

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/Promotions/creating-and-managing-coupons-with-promotions-api.md)

[Contextual price per shopper« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api//docs/guides/contextual-price-per-shopper)[Using Policy Engine API on Promotion AlertsNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api//docs/guides/using-policy-engine-api-on-promotion-alerts)

Contributors

2

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)

ON THIS PAGE

[Restrictions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23restrictions)

[How to create a coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23how-to-create-a-coupon)

[How to edit a coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23how-to-edit-a-coupon)

[How to archive a coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23how-to-archive-a-coupon)

[Examples of usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23examples-of-usage)

[Creating 50 coupons](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23creating-50-coupons)[Creating single-use coupon and promotion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23creating-single-use-coupon-and-promotion)[Coupon massive generation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23coupon-massive-generation)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/Promotions/creating-and-managing-coupons-with-promotions-api.md)

Copy page

On this page

ON THIS PAGE

[Restrictions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23restrictions)

[How to create a coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23how-to-create-a-coupon)

[How to edit a coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23how-to-edit-a-coupon)

[How to archive a coupon](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23how-to-archive-a-coupon)

[Examples of usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23examples-of-usage)

[Creating 50 coupons](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23creating-50-coupons)[Creating single-use coupon and promotion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23creating-single-use-coupon-and-promotion)[Coupon massive generation](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/creating-and-managing-coupons-with-promotions-api/docs/guides/creating-and-managing-coupons-with-promotions-api%23coupon-massive-generation)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides faststore themes midnight in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore)

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/getting-started-faststore-versions-and-support-levels)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/getting-started-overview)

[FastStore WebOps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/webops-dashboard)

[Headless CMS](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/headless-cms-overview)

[Developer tools and references](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/developer-tools-overview)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/styling-overview)

[Themes reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-overview)

[Soft blue](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-soft-blue)

[Midnight](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-midnight)

[Global tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/global-tokens-overview)

[Iconography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/styling-icons)

[Using themes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/using-themes-overview)

[UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/components-index)

[Implementing storefront features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/storefront-features-overview)

[FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/faststore-api-overview)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/sdk-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/developing-and-overriding-components-overview)

[Extending the FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/api-extensions-overview)

[Managing URLs with redirects and rewrite paths](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/routing-managing-urls-with-redirects-and-rewrite-paths)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/managing-performance-overview)

[SEO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/seo-overview)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/go-live-overview)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/troubleshooting-overview)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/store-framework)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/storefront-best-practices)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore)

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/getting-started-faststore-versions-and-support-levels)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/getting-started-overview)

[FastStore WebOps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/webops-dashboard)

[Headless CMS](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/headless-cms-overview)

[Developer tools and references](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/developer-tools-overview)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/styling-overview)

[Themes reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-overview)

[Soft blue](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-soft-blue)

[Midnight](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-midnight)

[Global tokens](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/global-tokens-overview)

[Iconography](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/styling-icons)

[Using themes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/using-themes-overview)

[UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/components-index)

[Implementing storefront features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/storefront-features-overview)

[FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/faststore-api-overview)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/sdk-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/developing-and-overriding-components-overview)

[Extending the FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/api-extensions-overview)

[Managing URLs with redirects and rewrite paths](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/routing-managing-urls-with-redirects-and-rewrite-paths)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/managing-performance-overview)

[SEO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/seo-overview)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/go-live-overview)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/troubleshooting-overview)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/store-framework)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/storefront-best-practices)

---

[Storefront development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/storefront-development)

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/styling-overview)

[Themes reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-overview)

Midnight

A darkmode theme created for testing purposes.

A darkmode theme for your storefront.

![{"base64":"  ","img":{"width":1889,"height":719,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":858304,"url":"https://vtexhelp.vtexassets.com/assets/docs/src/midnight___2bb274e36a39ff9c2cfa3dcc740cbfab.png"}}](https://read.calvincode.net/reader?url=https://vtexhelp.vtexassets.com/assets/docs/src/midnight___2bb274e36a39ff9c2cfa3dcc740cbfab.png)

## Use `midnight` as your theme

1. In your [starter project](https://read.calvincode.net/reader?url=https://github.com/vtex-sites/starter.store), create a new file named `midnight.scss` in `src/themes`.
2. Add the following styles to `src/themes/midnight.scss`:

src/themes/midnight.scss

`1

// ----------------------------------------------------------

2

// GLOBAL TOKENS

3

// Theme Midnight

4

// ----------------------------------------------------------

5

6

.theme {

7

 // --------------------------------------------------------

8

 // Colors (Branding Core)

9

 // --------------------------------------------------------

10

11

 // PALETTE

12

 --fs-color-main-0: #0b0022;

13

 --fs-color-main-1: #13013e;

14

 --fs-color-main-2: #190054;

15

 --fs-color-main-3: #41208d;

16

 --fs-color-main-4: #6535d6;

17

18

 --fs-color-accent-0: #25046d;

19

 --fs-color-accent-1: #001082;

20

 --fs-color-accent-2: #0017b9;

21

 --fs-color-accent-3: #1930d3;

22

 --fs-color-accent-4: #4d62ff;

23

24

 --fs-color-neutral-0: #110035;

25

 --fs-color-neutral-1: #260f5a;

26

 --fs-color-neutral-2: #74808b;

27

 --fs-color-neutral-3: #9099a2;

28

 --fs-color-neutral-4: #c7ccd1;

29

 --fs-color-neutral-5: #e3e6e8;

30

 --fs-color-neutral-6: #816ba9;

31

 --fs-color-neutral-7: #dfd2fc;

32

33

 // HIERARCHY

34

 --fs-color-primary-bkg: var(--fs-color-main-3);

35

 --fs-color-primary-bkg-light: var(--fs-color-main-2);

36

 --fs-color-primary-text: var(--fs-color-neutral-7);

37

38

 --fs-color-secondary-text: var(--fs-color-neutral-7);

39

40

 --fs-color-tertiary-bkg-hover: var(--fs-color-main-2);

41

 --fs-color-tertiary-bkg-active: var(--fs-color-main-3);

42

43

 // COMPONENTS & STATES

44

 --fs-color-body-bkg: var(--fs-color-main-0);

45

 --fs-body-bkg: linear-gradient(

46

 0deg,

47

 var(--fs-color-main-0) 0%,

48

 var(--fs-color-main-2) 20%,

49

 var(--fs-color-main-0) 100%

50

 );

51

52

 --fs-color-text-display: var(--fs-color-neutral-7);

53

54

 --fs-color-link: var(--fs-color-neutral-7);

55

 --fs-color-link-inverse: var(--fs-color-neutral-7);

56

57

 // SITUATIONS

58

 --fs-color-success-text: #50b191;

59

 --fs-color-success-bkg: #007043;

60

 --fs-color-warning-bkg: #b17000;

61

 --fs-color-disabled-bkg: var(--fs-color-main-3);

62

63

 // --------------------------------------------------------

64

 // Typography (Branding Core)

65

 // --------------------------------------------------------

66

67

 // FACE

68

 --fs-text-face-body: 'Raleway', sans-serif;

69

70

 // NUMERIC SCALE

71

 --fs-text-size-base: 18px; // 1rem

72

 --fs-text-size-0: 14px; // Smallest

73

 --fs-text-size-1: 16px; // Smaller

74

75

 // --------------------------------------------------------

76

 // Refinements

77

 // --------------------------------------------------------

78

79

 // BORDERS

80

 --fs-border-radius: 20px;

81

82

 --fs-border-width: 2px;

83

84

 --fs-border-color-light: var(--fs-color-main-3);

85

 --fs-border-color: var(--fs-color-main-3);

86

 --fs-border-color-hover: var(--fs-color-main-2);

87

 --fs-border-color-active: var(--fs-color-main-3);

88

89

 // SHADOW

90

 --fs-shadow-hover: 0 0 10px rgb(40 21 132 / 30%), 0 0 0 10px var(--fs-color-main-1);

91

92

 // --------------------------------------------------------

93

 // FS UI Components

94

 // --------------------------------------------------------

95

96

 --fs-logo-width: 8rem;

97

98

 .section {

99

 // Add here the customizations for FastStore UI components.

100

101

 [data-fs-skeleton] {

102

 --fs-skeleton-shimmer-bkg-color: var(--fs-color-disabled-bkg);

103

 }

104

105

 [data-fs-hero] {

106

 --fs-hero-image-border-radius: 130px 0 0 130px;

107

 --fs-hero-main-bkg-color: var(--fs-color-main-1);

108

 }

109

110

 [data-fs-button] {

111

 --fs-button-border-radius: var(--fs-border-radius-pill);

112

113

 --fs-button-primary-inverse-text-color: var(--fs-color-neutral-0);

114

 --fs-button-primary-inverse-text-color-hover: var(--fs-color-text);

115

 --fs-button-primary-inverse-text-color-active: var(--fs-color-neutral-7);

116

117

 --fs-button-primary-border-color: var(--fs-color-neutral-7);

118

119

 --fs-button-tertiary-text-color-active: var(--fs-color-text);

120

 }

121

122

 [data-fs-input] {

123

 --fs-input-text-size: 16px;

124

 background-color: var(--fs-color-body-bkg);

125

 }

126

127

 [data-fs-input-field] {

128

 --fs-input-field-size: 16px;

129

 }

130

131

 [data-fs-product-card] {

132

 --fs-product-card-padding: var(--fs-spacing-2) var(--fs-spacing-2) var(

133

 --fs-spacing-4

134

 ) var(--fs-spacing-2);

135

 --fs-product-card-bkg-color: var(--fs-color-main-0);

136

 --fs-product-card-img-scale-hover: 1.05;

137

 }

138

139

 [data-fs-newsletter] {

140

 --fs-newsletter-text-color: var(--fs-color-text-display);

141

 }

142

143

 [data-fs-navbar] {

144

 --fs-navbar-bkg-color: var(--fs-color-main-0);

145

 }

146

147

 [data-fs-footer] {

148

 --fs-footer-bkg-color: var(--fs-color-main-0);

149

 }

150

 }

151

}

`

1. Go to `discovery.config.js` and change the `theme` to `midnight`:

`1

theme: 'midnight',

`

1. To preview how the new theme looks in your store, open the terminal, run `yarn dev`, and access the local server.

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F67270558%3Fv%3D4%26w=64%26q=75)](https://github.com/mariana-caetano)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/faststore/docs/styling/themes/midnight.mdx)

[Soft blue« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-soft-blue)[Global tokensNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/global-tokens-overview)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F67270558%3Fv%3D4%26w=64%26q=75)](https://github.com/mariana-caetano)

ON THIS PAGE

[Use midnight as your theme](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-midnight%23use-midnight-as-your-theme)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/faststore/docs/styling/themes/midnight.mdx)

Copy page

On this page

ON THIS PAGE

[Use midnight as your theme](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/themes-midnight/docs/guides/faststore/themes-midnight%23use-midnight-as-your-theme)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides faststore analytics use analytics event in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore)

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/getting-started-faststore-versions-and-support-levels)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/getting-started-overview)

[FastStore WebOps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/webops-dashboard)

[Headless CMS](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/headless-cms-overview)

[Developer tools and references](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/developer-tools-overview)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/styling-overview)

[UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/components-index)

[Implementing storefront features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/storefront-features-overview)

[FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/faststore-api-overview)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/sdk-overview)

[Analytics](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-overview)

[sendAnalyticsEvent](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-send-analytics-event)

[useAnalyticsEvent](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event)

[Sending custom events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-sending-custom-events)

[Extending and customizing native types](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-extending-and-customizing-native-types)

[Use case: Implementing custom newsletter analytics events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-implementing-custom-newsletter-analytics-events)

[Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/cart-overview)

[Search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/search-overview)

[Session](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/session-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/developing-and-overriding-components-overview)

[Extending the FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/api-extensions-overview)

[Managing URLs with redirects and rewrite paths](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/routing-managing-urls-with-redirects-and-rewrite-paths)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/managing-performance-overview)

[SEO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/seo-overview)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/go-live-overview)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/troubleshooting-overview)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/store-framework)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/storefront-best-practices)

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/updates/release-notes)

Storefront Development

[Getting started with storefront solutions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/getting-started-with-storefront-solutions)

---

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore)

[FastStore versions and support levels](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/getting-started-faststore-versions-and-support-levels)

[Getting Started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/getting-started-overview)

[FastStore WebOps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/webops-dashboard)

[Headless CMS](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/headless-cms-overview)

[Developer tools and references](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/developer-tools-overview)

[Styling](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/styling-overview)

[UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/components-index)

[Implementing storefront features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/storefront-features-overview)

[FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/faststore-api-overview)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/sdk-overview)

[Analytics](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-overview)

[sendAnalyticsEvent](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-send-analytics-event)

[useAnalyticsEvent](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event)

[Sending custom events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-sending-custom-events)

[Extending and customizing native types](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-extending-and-customizing-native-types)

[Use case: Implementing custom newsletter analytics events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-implementing-custom-newsletter-analytics-events)

[Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/cart-overview)

[Search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/search-overview)

[Session](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/session-overview)

[Developing and overriding UI components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/developing-and-overriding-components-overview)

[Extending the FastStore API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/api-extensions-overview)

[Managing URLs with redirects and rewrite paths](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/routing-managing-urls-with-redirects-and-rewrite-paths)

[Managing performance](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/managing-performance-overview)

[SEO](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/seo-overview)

[Going live](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/go-live-overview)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/troubleshooting-overview)

---

[Store Framework](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/store-framework)

---

(Legacy) CMS Portal

---

[Storefront best practices](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/storefront-best-practices)

---

[Storefront development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/storefront-development)

[FastStore](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore)

[FastStore SDK](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/sdk-overview)

[Analytics](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-overview)

useAnalyticsEvent

The `useAnalyticsEvent` hook intercepts both native and custom events triggered by the [sendAnalyticsEvent](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-send-analytics-event) function. The hook automatically detects the events sent by `sendAnalyticsEvent` and provides a response to them.

## Import

`1

import type { AnalyticsEvent } from '@faststore/sdk'

2

import { useAnalyticsEvent } from '@faststore/sdk'

`

## Usage

The `useAnalyticsEvent` hook accepts a callback function that runs whenever the `sendAnalyticsEvent` is triggered. The callback function receives the event that triggered its execution as an argument.

Ideally, you should use the `useAnalyticsEvent` hook to transmit events to the analytics provider of your choice (e.g., Google Analytics).

`1

import type { AnalyticsEvent } from '@faststore/sdk'

2

import { useAnalyticsEvent } from '@faststore/sdk'

3

4

export const AnalyticsHandler = () => {

5

 useAnalyticsEvent((event: AnalyticsEvent) => {

6

 /**

7

 * This is where you can send events to your analytics provider

8

 *

9

 * Example:

10

 * window.dataLayer.push({ event: event.name, ecommerce: event.params })

11

 */

12

 })

13

14

 /* ... */

15

}

`

## Events from external libraries

External libraries can also send events via the Analytics module, which means you might come across unexpected events being intercepted by `useAnalyticsEvent`. This is usually not an issue, as most common analytics providers don't break if you send them meaningless data. However, if that's the case, filter events by name to ensure only the desired events are sent to the provider.

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F67270558%3Fv%3D4%26w=64%26q=75)](https://github.com/mariana-caetano)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/faststore/docs/sdk/analytics/use-analytics-event.mdx)

[sendAnalyticsEvent« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-send-analytics-event)[Sending custom eventsNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-sending-custom-events)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F67270558%3Fv%3D4%26w=64%26q=75)](https://github.com/mariana-caetano)

ON THIS PAGE

[Import](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event%23import)

[Usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event%23usage)

[Events from external libraries](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event%23events-from-external-libraries)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/faststore/docs/sdk/analytics/use-analytics-event.mdx)

Copy page

On this page

ON THIS PAGE

[Import](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event%23import)

[Usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event%23usage)

[Events from external libraries](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/faststore/analytics-use-analytics-event/docs/guides/faststore/analytics-use-analytics-event%23events-from-external-libraries)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)


[System] You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.

[User] Provide a guide on guides views in VTEX.

[Assistant]
Documentation

[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)

[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides)

[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/api-reference)

[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/app-development)

[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/storefront-development)

[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/vtex-io-apps)

[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/troubleshooting)

[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/updates/release-notes)

Guides

[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/vtex-platform-overview)

---

[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/api-usage)

---

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/getting-started)

---

Integration Guides

---

[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/catalog-integration)

---

[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/checkout-api-overview)

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/master-data)

---

Payments

---

Orders

---

Logistics

---

B2B Suite

---

VTEX Sales App

---

UI Customization

---

Message Center

---

Pricing

---

Promotions

---

Infrastructure

---

Search

---

Storefront Permissions

---

[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/activity-flow)

---

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/vtex-ads)

[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/getting-started-with-vtex-ads-api)

[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/synchronizing-the-catalog-with-vtex-ads)

[Retrieving ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/retrieving-ads)

[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/ads-events)

[Understanding ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/understanding-ads-events)

[Ads events notification](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/ads-events-notification)

[Impressions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/impressions)

[Views](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views)

[Clicks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/clicks)

[Conversion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/conversion)

---

VTEX Session

---

VTEX Shield

---

[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/data-protection-plus)

---

Weni by VTEX

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides)

[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/api-reference)

[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/app-development)

[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/storefront-development)

[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/vtex-io-apps)

[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/troubleshooting)

---

[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/updates/release-notes)

Guides

[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/vtex-platform-overview)

---

[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/api-usage)

---

[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/getting-started)

---

Integration Guides

---

[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/catalog-integration)

---

[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/checkout-api-overview)

---

[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/master-data)

---

Payments

---

Orders

---

Logistics

---

B2B Suite

---

VTEX Sales App

---

UI Customization

---

Message Center

---

Pricing

---

Promotions

---

Infrastructure

---

Search

---

Storefront Permissions

---

[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/activity-flow)

---

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/vtex-ads)

[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/getting-started-with-vtex-ads-api)

[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/synchronizing-the-catalog-with-vtex-ads)

[Retrieving ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/retrieving-ads)

[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/ads-events)

[Understanding ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/understanding-ads-events)

[Ads events notification](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/ads-events-notification)

[Impressions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/impressions)

[Views](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views)

[Clicks](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/clicks)

[Conversion](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/conversion)

---

VTEX Session

---

VTEX Shield

---

[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/data-protection-plus)

---

Weni by VTEX

---

[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides)

[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/vtex-ads)

[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/getting-started-with-vtex-ads-api)

[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/ads-events)

[Views](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views)

Views

Track views for banner ads.

VTEX Ads uses view tracking to measure when banner advertisements are effectively displayed to users. This guide explains how to properly send view events when banner ads become visible to users.

## View event rules

* View events should only be sent for banner ads.
* View events require both `user_id` and `session_id` for proper attribution.
* View URLs are unique to each ad and should be obtained from the [Get ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/vtex-ads-api%23post-/v1/rma/-publisher%5Fid-) response.

> 🚧 Don't construct event URLs manually. Always use the URL provided from the `POST` [Get ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/vtex-ads-api%23post-/v1/rma/-publisher%5Fid-) request.
>
> This is extremely important to ensure long-term stability of the integration, because the parameters of the event URL may change over time, but the integration itself does not.

## Sending a view event

Use the `POST` [Track ad views](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/vtex-ads-api%23post-/v1/beacon/view/-ad%5Fid-) endpoint to send view events. Check the endpoint documentation for detailed information about all available fields.

Request example:

`1

POST https://events.newtail-media.newtail.com.br/v1/beacon/view/4a94bc6e-7db1-425f-8430-cb4d17488b3b?pos=1 HTTP/1.1

2

accept: application/json

3

content-type: application/json

4

5

{

6

 "user_id": "6f92d1e9-00b6-4f8b-9645-faeab321e1cc",

7

 "session_id": "5898b8d1-c250-4bb5-931b-8b9d0ee7b499"

8

}

`

Successful response example:

> A successful response will have HTTP code 202.

`1

{

2

 "messages": [

3

 "view will be processed soon"

4

 ]

5

}

`

Failed response example:

> A failed response will have HTTP code 422\. The error message follows the [RFC 8927](https://read.calvincode.net/reader?url=https://datatracker.ietf.org/doc/rfc8927/) format.

`1

[

2

 {

3

 "instancePath": "",

4

 "keyword": "required",

5

 "message": "must have required property 'user_id'",

6

 "params": { "missingProperty": "user_id" },

7

 "schemaPath": "#/anyOf/0/required"

8

 },

9

 {

10

 "instancePath": "",

11

 "keyword": "required",

12

 "message": "must have required property 'session_id'",

13

 "params": { "missingProperty": "session_id" },

14

 "schemaPath": "#/anyOf/1/required"

15

 },

16

 {

17

 "instancePath": "",

18

 "keyword": "anyOf",

19

 "message": "must match a schema in anyOf",

20

 "params": {},

21

 "schemaPath": "#/anyOf"

22

 }

23

]

`

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)

Was this helpful?

Yes

No

[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/VTEX Ads/getting-started-with-vtex-ads-api/ads-events/views.md)

[Impressions« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views//docs/guides/impressions)[ClicksNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views//docs/guides/clicks)

Contributors

1

[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)

ON THIS PAGE

[View event rules](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views%23view-event-rules)

[Sending a view event](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views%23sending-a-view-event)

Was this helpful?

 Send feedback

[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/VTEX Ads/getting-started-with-vtex-ads-api/ads-events/views.md)

Copy page

On this page

ON THIS PAGE

[View event rules](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views%23view-event-rules)

[Sending a view event](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/views/docs/guides/views%23sending-a-view-event)

On this page

[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)