metakeen
v2.0.5
Published
Core pageview tracking shared across all Keen web projects.
Downloads
13
Readme
Metakeen.js
What is this project?
This project is meant to be a simple to use Javascript library that we include on all Keen IO web projects to track pageviews with a consistent approach and data model. It's meant to be dropped into Keen-Statics, Keen-Web and all other upcoming web projects to track pageviews without requiring any advanced configuration. Core things to know about this library:
- It tracks
pageviews
events automatically on any page it's loaded on. - It requests the currently logged in user's data (if available) from Keen-Web.
- It stores the
firstInternalReferrer
,firstExternalReferrer
, and other referrer properties in a cookie to be sent along with eachpageview
event. - It sends along all the user, organization, project and page data is has available to it with each event that is tracked through it, so you only need to add the specific custom properties you want tracked.
- It updates Intercom with the user and organization information when it becomes available.
What's under the hood?
- Makes use of the
keen-tracking.js
library to handle tracking pageviews, setting up cookies, etc.
How to use it
Include the script from the CDN:
<!-- Metakeen.js -->
<script src="https://d26b395fwzu5fz.cloudfront.net/metakeen-1.2.1.min.js"></script>
<script>
$(document).ready(function(){
window.metakeenClient = new window.Metakeen({
enabled: true,
debug: true,
projectId: PROJECT_ID,
writeKey: PROJECT_WRITE_KEY
});
});
</script>
Contributing to this project:
- Create the PR, including the build files created with
npm run build
. - Get a +1.
- Merge into
master
. - Create a new PR with a new release of metakeen, essentially just a version bump in
package.json
. - Merge that PR.
- Run the
deploy
npm task to get the new version on to our CDN. - Update
keen-statics
,keen-web
and any other project that uses this library to the latest version.