pageviewΒΆ

harvest.trackEvent({
    "event":"pageview",
    "data": {}
});

The code above can be used to track a pageview. As you can see the event-property has the value pageview.

An example of tracking a pageview where we specify a pageCategory and pageLanguage can be viewed below.

For example we have the pageCategory: Customer service -> Shipping.

This category of pages contain the following pages:

../customer-service/shipping/shipping-cost-calculation.html ../customer-service/shipping/return.html

When viewing on of these pages in English, the tracking will be as follows:

harvest.trackEvent({
    "event":"pageview",
    "data": {
        "pageLanguage": "en",
        "pageCategory": "customer-service/shipping"
    }
});

When using the Javascript API you have to call the API yourself when a page is loaded. It is also possible to use data attributes. This way the moment the HTML of the page is loaded, the pageview is triggered. You can do this with the data-track-page attribute.