Skip to content
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

Update JSDoc for pbjs.enableAnalytics #1565

Merged
merged 1 commit into from
Oct 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,17 @@ $$PREBID_GLOBAL$$.loadScript = function (tagSrc, callback, useCache) {
};

/**
* Will enable sending a prebid.js to data provider specified
* @param {Object} config object {provider : 'string', options : {}}
* Enable sending analytics data to the analytics provider of your
* choice.
*
* For usage, see [Integrate with the Prebid Analytics
* API](http://prebid.org/dev-docs/integrate-with-the-prebid-analytics-api.html).
*
* For a list of supported analytics adapters, see [Analytics for
Copy link
Contributor

@dbemiller dbemiller Sep 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth mentioning the build step somewhere in here? Since the behavior of the method changes depending on which adapters you built with.

Or perhaps a better way is if we just make the code throw an error if you specify an invalid one. We could then make the error message say something like "No analytics adapter found for code XYZ. Did you forget to include it in your gulp build --modules?"

Not sure which one makes the better user experience? Maybe both...

* Prebid](http://prebid.org/overview/analytics.html).
* @param {Object} config
* @param {string} config.provider The name of the provider, e.g., `"ga"` for Google Analytics.
* @param {Object} config.options The options for this particular analytics adapter. This will likely vary between adapters.
*/
$$PREBID_GLOBAL$$.enableAnalytics = function (config) {
if (config && !utils.isEmpty(config)) {
Expand Down