1. Home
  2. Technical docs
  3. Integration
  4. Extending session_start and global properties

Extending session_start and global properties

There are some specific cases when you would like to extend session_start and all other events tracked with global properties. Common use case is to set event property with version of website or application into each event.

You can also modify page_visit event by adding global property.

Extending session_start

ping.properties SDK configuration will set additional properties to session_start and session_end events

exponea.initialize({
    ...
    ping: {
        properties: {
            application_version: "v1.0.0"
        }
    }
    ...
});

Extending all other events

track.default_properties SDK configuration will set additional properties to all events tracked

exponea.initialize({
    ...
    track: {
        default_properties: {
            application_version: "v1.0.0"
        }
    }
    ...
});

Example of initialize

Sample configuration

exponea.initialize({
    token: "PROJECT TOKEN HERE",
    ping: {
        properties: {
            application_version: "v1.0.0"
        }
    },
    track: {
        visits: true,
        default_properties: {
            application_version: "v1.0.0"
        }
    }
});

Result

Sample

 

User agent in browser

exponea.initialize({
    ...
    ping: {
        properties: {
            user_agent: navigator.userAgent
        }
    }
    ...
});

 

Updated on August 31, 2017

Was this article helpful?

Related Articles