-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuring heap integration settings #734
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,9 @@ var toString = Object.prototype.toString; // in case this method has been overri | |
var Heap = (module.exports = integration('Heap') | ||
.global('heap') | ||
.option('appId', '') | ||
.tag('<script src="//cdn.heapanalytics.com/js/heap-{{ appId }}.js">')); | ||
.option('hostname', 'cdn.heapanalytics.com') | ||
.option('options', {}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The heap JS docs list some of the options, but there are additional options which are not documented. That leads me to believe that it might be best to just provide a single options object, since the allowed options might be account-specific and it might be confusing to provide some configuration options here that aren't available to all accounts. However, I'm happy to split this out into specific configuration options. |
||
.tag('<script src="//{{ hostname }}/js/heap-{{ appId }}.js">')); | ||
|
||
/** | ||
* Initialize. | ||
|
@@ -61,7 +63,7 @@ Heap.prototype.initialize = function() { | |
}); | ||
}; | ||
|
||
window.heap.load(this.options.appId); | ||
window.heap.load(this.options.appId, this.options.options); | ||
this.load(this.ready); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some variation in how different integrations name this sort of parameter, so I wasn't sure of the best name. I'm happy to change to something else.