Skip to main content

Attach custom properties to pageviews

Using WordPress?

The quickest way to start tracking custom properties is to use our official WordPress plugin

Add your custom properties to your avasda snippet

You can add custom properties by updating your avasda snippet.

To add properties that attach to every tracked event, update the avasda.init call to pass customProperties option:

avasda.init({
// ... Other initialization options
customProperties: {
author: "John Doe",
type: "blog-post"
}
})

You're now tracking custom properties alongside pageviews.

Advanced: Dynamically setting custom properties

To include dynamic data for custom properties, set customProperties to be a function. This function will be called for every event.

For example:

avasda.init({
// ... Other initialization options
customProperties: function(eventName) {
if (eventName == "pageview") {
return {
author: "John Doe",
title: document.title
}
}

return {}
}
})

Haven't tried avasda yet? Start a free trial or view the live demo.