This page explains the technical setup required for your imported attributes in order to trigger abandoned category campaigns in Ometria.
The setup is only required if you were an Ometria customer before November 2019.
Magento users: the Magento importers automatically pick up all Magento categories by default, so there is no setup required if you are using Magento 1 or 2. You can go directly to Setting up an abandoned category campaign.
Custom importers
If you have a custom importer then you can use your existing attributes - as long as you tag them to your pages as described below.
If you want to create new attributes you must re-push the product object with the new attributes.
Tagging attributes to pages
Once you’ve created your attributes, the page attribute needs to be passed to the ‘init’ method of the Ometria JavaScript Interaction API as a pageData object for any page type.
For example:
ometria.init('homepage', pageData, "storeID");
The required pageData is a JSON object, in which you’ll need to specify an ‘attributes’ key containing a list of objects representing the “id” and “type” of each attribute for a given page:
- The “id” key is your unique identifier represented by a string.
- The “type” key is the attribute type represented by a string.
For example:
```json { "attributes": [ { "id": "dresses", "type": "department" },
{ "id": "celebrations", "type": "category" } ] } ```
Simply pass your desired attributes via the ‘init’ method as follows:
```javascript ometria.init("listing",
{ "attributes": [ { "id": "dresses", "type": "department" },
{ "id": "celebrations", "type": "category" } ] }, "storeID"); ```
Shopify importer
Ometria supports the targeting of page visits for Shopify collections.
Update your liquid tags
We’ve added a new value to our Ometria script:
``` collection_handle: {{collection.handle|json}} ```
Follow the steps in the Shopify integration setup to update the Ometria JavaScript with the value above.
Here’s an example of the standard script - please check with your development agency if you have a custom Shopify integration:
``` <script> if (typeof ometria == 'undefined') window.ometria = {}; ometria.raw_data={ template:
{{template|json}}, cart_total:{{cart.total_price|json}},
cart_count:{{cart.item_count|json}}, cart:[],
product_id:{{product.id|json}},
search_count:{{search.results_count|json}},
search_terms:{{search.terms|json}},
collection_id:{{collection.id|json}},
collection_count:{{collection.products_count|json}},
collection_handle: {{collection.handle|json}},
current_page:{{current_page|json}},
shop_currency:{{shop.currency|json}},
Customer_email:{{customer.email|json}} }; ```
Comments
0 comments
Please sign in to leave a comment.