-
Notifications
You must be signed in to change notification settings - Fork 0
sentEventToSegmentio
Mike Byrne edited this page Jan 25, 2022
·
2 revisions
Tracks site wide requests for analytics events. Catches events before segment.io is ready, stores them and tries them again when it is ready. Follows conventions from segment.io: https://segment.com/docs/libraries/analytics.js/#selecting-integrations Checks a meta tag on init for identifying the user
- segment.io JS to be linked in the body
- none
- nothing
triggerCustomEvent('analytics',{
type: 'track',
name: 'Sponsor clicked',
properties: {
name: 'Coca-Cola'
}
});
triggerCustomEvent('analytics',{
type: 'page',
category: 'videos',
name: 'George Lucas',
properties: {
foo: bar
}
});
triggerCustomEvent('analytics',{
type: 'identify',
userID: '1312',
properties: {
name: 'Mike Byrne',
email: '[email protected]'
}
});
Requires metatag:
<meta name='analytics_user_info' content='id:1312,name:Mike Byrne,email:[email protected]' />
Include what info you need.