The installation involves the following steps:
1 - Add the app as a theme dependency in the manifest.json file.
_10 {_10 "dependencies": {_10 "vendor.newtail-media": "2.x"_10 }_10 }
2 - Add the publisher ID in the app configuration in the VTEX admin.
3 - Declare the app's blocks in the theme.
Development Mode
🚧
vtex workspace use newtail
All implementation will be done in the development environment. We will use the newtail workspace. After validation, we will publish it in the store's master environment.
Available Components
newtail-media-banner
This component is responsible for requesting, displaying, and managing events related to banner-type ads. It will display a banner in the designated location.newtail-media-shelf
This component is responsible for requesting, displaying, and managing events related to product-type ads. It will create a product carousel in the designated location using native VTEX components.newtail-media-search
This component is responsible for managing sponsored search results.newtail-media-conversion
This component is responsible for managing conversion events.
| For more information, visit the components page. There you can find specific documentation for each component and the properties they receive through block properties or via site editor.
Displaying Ads
We must add the corresponding components to the pages that will display the ads and make the necessary visual adjustments.
It is essential to have at least a basic understanding of VTEX block declaration.
📘 Implementation
Below, we will use the search page as an example.
store/blocks/search/
The file name may vary depending on the theme if it has been customized.
- Add ad display components.
_29{_29 "newtail-media-search": {_29 "props": {_29 "placementName": "nome_do_placement"_29 }_29 },_29 "newtail-media-banner": {_29 "title": "Newtail Banner - search_header",_29 "props": {_29 "placementName": "search_header",_29 "size": "leaderboard",_29 "sizeMobile": "large_rectangle",_29 }_29 },_29 "store.search": {_29 "blocks": [_29 "newtail-media-banner",_29 "newtail-media-shelf",_29 "search-result-layout"_29 ],_29 },_29 // ..._29 "search-result-layout.desktop": {_29 "children": [_29 "newtail-media-search",_29 "others-children"_29 ],_29 },_29}
- If there are variations in components to handle responsiveness, follow the same procedure.
_10{_10 "my-mobile-search-component": {_10 "props": {},_10 "children": [_10 "newtail-media-banner",_10 "newtail-media-shelf",_10 "another-children"_10 ]_10 }_10}
Notifying Conversion
📘 Implementation
We will also need to add a component to the OrderPlaced page to track conversion events.
- Add the
newtail-media-conversionto the configuration file of the Order Placed pagestore/blocks/orderplaced.jsonc.
The file name may vary depending on the theme if it has been customized.
_10{_10 "store.orderplaced": {_10 "blocks": [_10 "order-placed",_10 "newtail-media-conversion"_10 ]_10 }_10}