Created
January 1, 2015 16:55
-
-
Save Radagaisus/295966d7895d4c93c41a to your computer and use it in GitHub Desktop.
Daily Visit Custom Captain Up Action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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