Skip to content

Commit 0de4529

Browse files
committed
update from master
2 parents 57989ae + bea70c1 commit 0de4529

File tree

10 files changed

+38
-11
lines changed

10 files changed

+38
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
## Unreleased
22

3+
<<<<<<< HEAD
34
* Add initial_referrer and initial_referring_domain user properties, which persist the initial referrer for the duration of the user's session.
5+
=======
6+
## 2.6.2 (November 17, 2015)
7+
8+
* Fix bug where response code is not passed to XDomainRequest callback (affects IE versions 10 and lower).
9+
>>>>>>> origin/master
410
511
## 2.6.1 (November 6, 2015)
612

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Amplitude-Javascript
1010
```
1111
<script type="text/javascript">
1212
(function(t,e){var n=t.amplitude||{};var r=e.createElement("script");r.type="text/javascript";
13-
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.6.1-min.gz.js";
13+
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.6.2-min.gz.js";
1414
r.onload=function(){t.amplitude.runQueuedFunctions()};var s=e.getElementsByTagName("script")[0];
1515
s.parentNode.insertBefore(r,s);var i=function(){this._q=[];return this};function o(t){
1616
i.prototype[t]=function(){this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
@@ -172,8 +172,9 @@ amplitude.init('YOUR_API_KEY_HERE', null, {
172172
| includeReferrer | If `true`, includes `referrer` and `referring_domain` as user propeties on all events uploaded. | `false` |
173173
| batchEvents | If `true`, events are batched together and uploaded only when the number of unsent events is greater than or equal to `eventUploadThreshold` or after `eventUploadPeriodMillis` milliseconds have passed since the first unsent event was logged. | `false` |
174174
| eventUploadThreshold | Minimum number of events to batch together per request if `batchEvents` is `true`. | 30 |
175-
| eventUploadPeriodMillis | Amount of time in milliseconds that the SDK waits before uploading events if `batchEvents` is `true`. | 30*1000 |
175+
| eventUploadPeriodMillis | Amount of time in milliseconds that the SDK waits before uploading events if `batchEvents` is `true`. | 30\*1000 (30 sec) |
176176
| deviceId | Custom device ID to set | Randomly generated UUID |
177+
| sessionTimeout | Time between logged events before a new session starts in milliseconds | 30\*60\*1000 (30 min) |
177178

178179

179180
# Advanced #

amplitude-snippet.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function(t,e){var n=t.amplitude||{};var r=e.createElement("script");r.type="text/javascript";
2-
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.6.1-min.gz.js";
2+
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.6.2-min.gz.js";
33
r.onload=function(){t.amplitude.runQueuedFunctions()};var s=e.getElementsByTagName("script")[0];
44
s.parentNode.insertBefore(r,s);var i=function(){this._q=[];return this};function o(t){
55
i.prototype[t]=function(){this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));

amplitude.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,8 +2286,18 @@ Request.prototype.send = function(callback) {
22862286
var xdr = new window.XDomainRequest();
22872287
xdr.open('POST', this.url, true);
22882288
xdr.onload = function() {
2289-
callback(xdr.responseText);
2289+
callback(200, xdr.responseText);
22902290
};
2291+
xdr.onerror = function () {
2292+
// status code not available from xdr, try string matching on responseText
2293+
if (xdr.responseText === 'Request Entity Too Large') {
2294+
callback(413, xdr.responseText);
2295+
} else {
2296+
callback(500, xdr.responseText);
2297+
}
2298+
};
2299+
xdr.ontimeout = function () {};
2300+
xdr.onprogress = function() {};
22912301
xdr.send(querystring.stringify(this.data));
22922302
} else {
22932303
var xhr = new XMLHttpRequest();
@@ -3359,7 +3369,7 @@ module.exports = uuid;
33593369

33603370
}, {}],
33613371
12: [function(require, module, exports) {
3362-
module.exports = '2.6.1';
3372+
module.exports = '2.6.2';
33633373

33643374
}, {}],
33653375
13: [function(require, module, exports) {

amplitude.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "src/index.js",
44
"repo": "amplitude/amplitude-javascript",
55
"description": "Javascript library for Amplitude Analytics",
6-
"version": "2.6.1",
6+
"version": "2.6.2",
77
"keywords": [
88
"analytics",
99
"amplitude"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "amplitude-js",
33
"author": "Amplitude <support@amplitude.com>",
4-
"version": "2.6.1",
4+
"version": "2.6.2",
55
"license": "MIT",
66
"description": "Javascript library for Amplitude Analytics",
77
"keywords": [

src/amplitude-snippet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var as = document.createElement('script');
44
as.type = 'text/javascript';
55
as.async = true;
6-
as.src = 'https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.6.1-min.gz.js';
6+
as.src = 'https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.6.2-min.gz.js';
77
as.onload = function() { window.amplitude.runQueuedFunctions(); };
88
var s = document.getElementsByTagName('script')[0];
99
s.parentNode.insertBefore(as, s);

src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = '2.6.1';
1+
module.exports = '2.6.2';

src/xhr.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ Request.prototype.send = function(callback) {
1414
var xdr = new window.XDomainRequest();
1515
xdr.open('POST', this.url, true);
1616
xdr.onload = function() {
17-
callback(xdr.responseText);
17+
callback(200, xdr.responseText);
1818
};
19+
xdr.onerror = function () {
20+
// status code not available from xdr, try string matching on responseText
21+
if (xdr.responseText === 'Request Entity Too Large') {
22+
callback(413, xdr.responseText);
23+
} else {
24+
callback(500, xdr.responseText);
25+
}
26+
};
27+
xdr.ontimeout = function () {};
28+
xdr.onprogress = function() {};
1929
xdr.send(querystring.stringify(this.data));
2030
} else {
2131
var xhr = new XMLHttpRequest();

0 commit comments

Comments
 (0)