view command makes it possible for you to track which products your visitors view in your web store. It has to be called on the product pages your visitors open and should pass the item ID of the displayed products to Emarsys.
Emarys uses the data collected with this command for behavior analysis and personalization. You will also be able to use it to trigger events or personalize content in certain Emarsys products, such as the Automation Center, Smart Insight and Predict.
What happens with this data?
Within a few hours, the product views reported by the
view command are written to the following behavior fields in your contact database:
predict last session products – This field gets a pipe-separated list of the items reported via the last
item1 | item2…). A maximum of 10 items are stored in the field.
predict last session categories – This field is updated on the basis of an analysis of the data passed by the
predict top categories – This field is updated on the basis of an analysis of the data passed by the
It is the
view command that feeds data to Category Explorer, which will become available in the Emarsys Platform the day after the
view command starts sending in data from your store.
Where should this command go in my web store?
As product views has to be reported to Emarsys on all the product pages of your web store, you will have to add the command to all the product pages.
Who should I involve from my side?
view command is implemented on the store frontend, for which you will need a frontend developer. It is a single script, taking a single parameter:
How can I monitor if it works properly?
The Data Sources page is your starting point for troubleshooting any integration issues and monitoring your Web Extend implementation. It displays warning and error messages if there are issues with the command, while it allows you to monitor your visitors’ activity, including product views, in real time in a live ticker.
On the Data Sources > Site Traffic page, you can get an overview of the total product views in a selected period and compare it to your in-house website statistics.
testMode command to prevent test data from being written to your real contact database as this may skew your reporting.
- Issue the command only once on each product page.
- Do not use the
viewcommand on the category pages, where several products belonging to a given product category are shown. Use it only on product pages which present a single product (or a parent-level product with different variants, such as a shoe in different sizes).
- If you have a dedicated m.domain.com mobile page and a mobile app, do not forget to add the command to these as well. For mobile apps, use our SDK.
Check if it works
To see if the
view commands work properly on your website, do the following:
- In your browser, open a product page on your website.
- Open another tab in your browser, log in to your Emarsys account, go to Admin > Data Sources > Web Behavior and click Live Events in the upper right-hand corner. This will open the Live Events page.
- Select my visit in the second drop-down.
- You should see an event box containing a UTC timestamp, a cookie ID, the referring URL and a view box with the product you saw on the website.
On the Live Events page, you will see a product image in the view boxes if the products reported by the
view command are found in your product database. If no product image is shown, either a wrong ID was passed, or your uploaded product data is not up to date.
- Click the product, and check its details on the Product info page.
- If you have implemented the command correctly then the item ID of the product should match that of the product seen on you website.
You can also install our Inspector bookmarklet that allows you to monitor live the Web Extend commands called on your website. If you implemented the
view command correctly, it should appear in the Inspector overlay on all the product pages, and only on these pages.
If everything works as expected, deploy the code to your live environment.
Always remember to remove the
testMode command from your code first!
In this section, you can read about the tools you can use and the things you can do to check if the
view command is doing its job properly on your website.
Once your JS implementation has gone live, the Live Events ticker will start showing data in the Web Behavior box of the Data Sources page. The ticker should now show product views in real time.
- Check if Live Validator has any warnings or error messages related to the
- If it does, fix the issues or contact Emarsys support if you need help.
Site Traffic statistics
Compare your in-house data with our Total product views statistics shown on the Site Traffic page. The numbers should not differ by more than 5%.
Check contact DB field updates
Another way to validate product view data collection is to directly segment your contact database for the behavior field predict last session products using the
is not empty filter. The resulting segment should include all known contacts who have already viewed products on your web store at least once.