Skip to content

Instantly share code, notes, and snippets.

@Radagaisus
Created January 1, 2015 16:55
Show Gist options
  • Save Radagaisus/295966d7895d4c93c41a to your computer and use it in GitHub Desktop.
Save Radagaisus/295966d7895d4c93c41a to your computer and use it in GitHub Desktop.
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