Skip to content

Commit 4718eba

Browse files
committed
update readme
1 parent e814e09 commit 4718eba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ You can pass a callback function to logEvent, which will get called after receiv
125125

126126
The status and response from the server are passed to the callback function, which you might find useful. An example of a callback function which redirects the browser to another site after a response:
127127

128-
'''javascript
128+
```javascript
129129
var callback_function = function(status, response) {
130130
if (status === 200 && response === 'success') {
131131
// do something here
132132
}
133133
window.location.replace('URL_OF_OTHER_SITE');
134134
};
135-
'''
135+
```
136136

137-
In the case that `optOut` is true, then no event will be logged, but the callback will be run. In the case that `batchEvents` is true, if the batch requirements `eventUploadThreshold` and `eventUploadPeriodMillis` are not met when `logEvent` is called, then no request is sent, but the callback is still called.
137+
In the case that `optOut` is true, then no event will be logged, but the callback will be called. In the case that `batchEvents` is true, if the batch requirements `eventUploadThreshold` and `eventUploadPeriodMillis` are not met when `logEvent` is called, then no request is sent, but the callback is still called. In these cases, the callback will be called with an input status of 0 and response 'No request sent'.

0 commit comments

Comments
 (0)