Skip to main content

Tracking actions

Use the track method trackAction to manually register activity on a feature. For example, you can register engagement on feature CTA: Add To Cart in the next ways

Context-free

JS
window.datopus('trackAction', 'CTA: Add To Cart');

Leverage standard Datopus params to convey action's relation to HTML tag

JS
window.datopus('trackAction', 'CTA: Add To Cart', {
	elemTag: 'button',
	elemName: 'add-to-cart-btn',
	elemText: 'Add To Cart',
	elemEvent: 'click'
});

Add your own context

JS
window.datopus('trackAction', 'CTA: Add To Cart', {
	user_subscription: 'Premium',
	product_name: 'Product A',
	product_category: 'Category B'
});

Tracking views

Use the track method trackView to manually register a view on a feature. This method is useful for tracking when a feature appears on a page, also known as an impression.
By analyzing feature views and feature actions, businesses determine the Feature Engagement Rate.
JS
window.datopus('trackView', this.featureName);