Skip to content

Commit b4b89e5

Browse files
committed
update from master
2 parents 65ca855 + ad61f0c commit b4b89e5

20 files changed

+661
-110
lines changed

CHANGELOG.md

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

3+
* Add getSessionId helper method to fetch the current sessionId.
4+
* Add support for append user property operation.
35
* Add tracking of each user's initial_referrer property (which is captured as a set once operation). Referrer property captured once per user session.
46

7+
## 2.7.0 (December 1, 2015)
8+
9+
* If cookies are disabled by user, then fallback to localstorage to save the cookie data.
10+
* Migrate sessionId, lastEventTime, eventId, identifyId, and sequenceNumber to cookie storage to support sessions across different subdomains.
11+
512
## 2.6.2 (November 17, 2015)
613

714
* Fix bug where response code is not passed to XDomainRequest callback (affects IE versions 10 and lower).

README.md

Lines changed: 8 additions & 1 deletion
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.2-min.gz.js";
13+
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.7.0-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)));
@@ -101,6 +101,13 @@ The SDK supports the operations `set`, `setOnce`, `unset`, and `add` on individu
101101
amplitude.identify(identify);
102102
```
103103

104+
5. `append`: this will append a value or values to a user property. If the user property does not have a value set yet, it will be initialized to an empty list before the new values are appended. If the user property has an existing value and it is not a list, it will be converted into a list with the new value appended.
105+
106+
```javascript
107+
var identify = new amplitude.Identify().append('ab-tests', 'new-user-test').append('some_list', [1, 2, 3, 4, 'values']);
108+
amplitude.identify(identify);
109+
```
110+
104111
Note: if a user property is used in multiple operations on the same `Identify` object, only the first operation will be saved, and the rest will be ignored. In this example, only the set operation will be saved, and the add and unset will be ignored:
105112

106113
```javascript

amplitude-segment-snippet.min.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function(t,e){var n=t.amplitude||{};var r=function(){this._q=[];return this};function s(t){
22
r.prototype[t]=function(){this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
3-
return this}}var i=["add","set","setOnce","unset"];for(var o=0;o<i.length;o++){s(i[o]);
4-
}n.Identify=r;n._q=[];function a(t){n[t]=function(){n._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
3+
return this}}var i=["add","append","set","setOnce","unset"];for(var o=0;o<i.length;o++){
4+
s(i[o])}n.Identify=r;n._q=[];function a(t){n[t]=function(){n._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
55
}}var u=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify"];
66
for(var c=0;c<u.length;c++){a(u[c])}t.amplitude=n})(window,document);

amplitude-snippet.min.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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.2-min.gz.js";
2+
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.7.0-min.gz.js";
33
r.onload=function(){t.amplitude.runQueuedFunctions()};var s=e.getElementsByTagName("script")[0];
4-
s.parentNode.insertBefore(r,s);var i=function(){this._q=[];return this};function o(t){
4+
s.parentNode.insertBefore(r,s);var i=function(){this._q=[];return this};function a(t){
55
i.prototype[t]=function(){this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
6-
return this}}var a=["add","set","setOnce","unset"];for(var u=0;u<a.length;u++){o(a[u]);
7-
}n.Identify=i;n._q=[];function c(t){n[t]=function(){n._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
8-
}}var l=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify"];
9-
for(var p=0;p<l.length;p++){c(l[p])}t.amplitude=n})(window,document);
6+
return this}}var o=["add","append","set","setOnce","unset"];for(var u=0;u<o.length;u++){
7+
a(o[u])}n.Identify=i;n._q=[];function c(t){n[t]=function(){n._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
8+
}}var p=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify"];
9+
for(var l=0;l<p.length;l++){c(p[l])}t.amplitude=n})(window,document);

0 commit comments

Comments
 (0)