Skip to content

Commit c2ef2ef

Browse files
committed
Merge pull request #45 from amplitude/allow_multiple_apps_v2
Allow multiple apps v2
2 parents ca093a6 + 852e936 commit c2ef2ef

21 files changed

+4058
-1568
lines changed

CHANGELOG.md

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

3+
* Add support for logging events to multiple Amplitude apps. **Note this is a major update, and may break backwards compatability.** See [Readme](https://github.com/amplitude/Amplitude-Javascript#300-update-and-logging-events-to-multiple-amplitude-apps) for details.
34
* Fix bug where saveReferrer throws exception if sessionStorage is disabled.
45
* Log messages with a try/catch to support IE 8.
56

README.md

Lines changed: 116 additions & 43 deletions
Large diffs are not rendered by default.

amplitude-segment-snippet.min.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
(function(e,t){var r=e.amplitude||{};var n=function(){this._q=[];return this};function s(e){
2-
n.prototype[e]=function(){this._q.push([e].concat(Array.prototype.slice.call(arguments,0)));
3-
return this}}var i=["add","append","clearAll","set","setOnce","unset"];for(var o=0;o<i.length;o++){
4-
s(i[o])}r.Identify=n;r._q=[];function a(e){r[e]=function(){r._q.push([e].concat(Array.prototype.slice.call(arguments,0)));
5-
}}var c=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties"];
6-
for(var l=0;l<c.length;l++){a(c[l])}e.amplitude=r})(window,document);
1+
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=function(){this._q=[];return this;
2+
};function i(e){r.prototype[e]=function(){this._q.push([e].concat(Array.prototype.slice.call(arguments,0)));
3+
return this}}var s=["add","append","clearAll","set","setOnce","unset"];for(var o=0;o<s.length;o++){
4+
i(s[o])}n.Identify=r;var a=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties"];
5+
function c(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
6+
}}for(var n=0;n<a.length;n++){t(a[n])}}c(n);n.getInstance=function(e){e=(!e||e.length===0?"$default_instance":e).toLowerCase();
7+
if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};c(n._iq[e])}return n._iq[e]};e.amplitude=n;
8+
})(window,document);

amplitude-snippet.min.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
(function(e,t){var n=e.amplitude||{};var r=t.createElement("script");r.type="text/javascript";
1+
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script");r.type="text/javascript";
22
r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-2.9.0-min.gz.js";
3-
r.onload=function(){e.amplitude.runQueuedFunctions()};var s=t.getElementsByTagName("script")[0];
4-
s.parentNode.insertBefore(r,s);var i=function(){this._q=[];return this};function a(e){
5-
i.prototype[e]=function(){this._q.push([e].concat(Array.prototype.slice.call(arguments,0)));
3+
r.onload=function(){e.amplitude.runQueuedFunctions()};var i=t.getElementsByTagName("script")[0];
4+
i.parentNode.insertBefore(r,i);var s=function(){this._q=[];return this};function a(e){
5+
s.prototype[e]=function(){this._q.push([e].concat(Array.prototype.slice.call(arguments,0)));
66
return this}}var o=["add","append","clearAll","set","setOnce","unset"];for(var c=0;c<o.length;c++){
7-
a(o[c])}n.Identify=i;n._q=[];function u(e){n[e]=function(){n._q.push([e].concat(Array.prototype.slice.call(arguments,0)));
8-
}}var l=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties"];
9-
for(var p=0;p<l.length;p++){u(l[p])}e.amplitude=n})(window,document);
7+
a(o[c])}n.Identify=s;var u=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties"];
8+
function l(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
9+
}}for(var n=0;n<u.length;n++){t(u[n])}}l(n);n.getInstance=function(e){e=(!e||e.length===0?"$default_instance":e).toLowerCase();
10+
if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};l(n._iq[e])}return n._iq[e]};e.amplitude=n;
11+
})(window,document);

0 commit comments

Comments
 (0)