Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Daily Visit Custom Captain Up Action
// Only run the code when Captain Up has loaded on the page
captain.up(function() {
// Track a new 'daily_visit' custom action
captain.action('daily_visit', {
// Pass extra data about the action
entity: {
// The current page name
name: captain.get_page_title()
// The referrer URL
referrer: captain.player_info.referrer
// The current page URL
url: captain.player_info.url,
// The current monthly day
day: new Date().getDate(),
// The current month
month: new Date().getMonth(),
// The current year
year: new Date().getFullyYear()
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment