Skip to content

Commit 744ad1b

Browse files
committed
update docs
1 parent b9dbacd commit 744ad1b

File tree

7 files changed

+214
-247
lines changed

7 files changed

+214
-247
lines changed

amplitude.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ Amplitude.prototype._saveReferrer = function _saveReferrer(referrer) {
605605
/**
606606
* Saves unsent events and identifies to localStorage. JSON stringifies event queues before saving.
607607
* Note: this is called automatically every time events are logged, unless you explicitly set option saveEvents to false.
608-
* @public
608+
* @private
609609
*/
610610
Amplitude.prototype.saveEvents = function saveEvents() {
611611
if (!this._apiKeySet('saveEvents()')) {
@@ -746,8 +746,8 @@ Amplitude.prototype.clearUserProperties = function clearUserProperties(){
746746
* Send an identify call containing user property operations to Amplitude servers.
747747
* See [Readme]{@link https://github.com/amplitude/Amplitude-Javascript#user-properties-and-user-property-operations}
748748
* for more information on the Identify API and user property operations.
749-
* @param {Identify_object} identify_obj - the Identify object containing the user property operations to send.
750-
* @param {function} opt_callback - (optional) callback function to run when the identify event has been sent.
749+
* @param {Identify} identify_obj - the Identify object containing the user property operations to send.
750+
* @param {Amplitude~eventCallback} opt_callback - (optional) callback function to run when the identify event has been sent.
751751
* Note: the server response code and response body from the identify event upload are passed to the callback function.
752752
* @example
753753
* var identify = new amplitude.Identify().set('colors', ['rose', 'gold']).add('karma', 1).setOnce('sign_up_date', '2016-03-31');
@@ -888,13 +888,21 @@ Amplitude.prototype._limitEventsQueued = function _limitEventsQueued(queue) {
888888
}
889889
};
890890

891+
/**
892+
* This is the callback for logEvent and identify calls. It gets called after the event/identify is uploaded,
893+
* and the server response code and response body from the upload request are passed to the callback function.
894+
* @callback Amplitude~eventCallback
895+
* @param {number} responseCode - Server response code for the event / identify upload request.
896+
* @param {string} responseBody - Server response body for the event / identify upload request.
897+
*/
898+
891899
/**
892900
* Log an event with eventType and eventProperties
893901
* @public
894902
* @param {string} eventType - name of event
895903
* @param {object} eventProperties - (optional) an object with string keys and values for the event properties.
896-
* @param {function} opt_callback - (optional) a callback function to run after the event is logged.
897-
* Note: the server response code and response body from the identify event upload are passed to the callback function.
904+
* @param {Amplitude~eventCallback} opt_callback - (optional) a callback function to run after the event is logged.
905+
* Note: the server response code and response body from the event upload are passed to the callback function.
898906
* @example amplitude.logEvent('Clicked Homepage Button', {'finished_flow': false, 'clicks': 15});
899907
*/
900908
Amplitude.prototype.logEvent = function logEvent(eventType, eventProperties, opt_callback) {
@@ -970,8 +978,8 @@ var _removeEvents = function _removeEvents(scope, eventQueue, maxId) {
970978
/**
971979
* Send unsent events. Note: this is called automatically after events are logged if option batchEvents is false.
972980
* If batchEvents is true, then events are only sent when batch criterias are met.
973-
* @public
974-
* @param {function} callback - (optional) callback to run after events are sent.
981+
* @private
982+
* @param {Amplitude~eventCallback} callback - (optional) callback to run after events are sent.
975983
* Note the server response code and response body are passed to the callback as input arguments.
976984
*/
977985
Amplitude.prototype.sendEvents = function sendEvents(callback) {

0 commit comments

Comments
 (0)