Skip to content

Commit b14f326

Browse files
committed
Update to version 2 of data collection API.
* Send client upload time and checksum * Rename setGlobalUserProperties to setUserProperties (setGlobalUserProperties kept for backward compatibility)
1 parent 1bc5132 commit b14f326

File tree

6 files changed

+235
-27
lines changed

6 files changed

+235
-27
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Amplitude-Javascript
77

88
<script type="text/javascript">
99
(function(h,a){var f=h.amplitude||{};var b=a.createElement("script");b.type="text/javascript";
10-
b.async=true;b.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-1.1-min.js";
10+
b.async=true;b.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-1.2-min.js";
1111
var g=a.getElementsByTagName("script")[0];g.parentNode.insertBefore(b,g);
1212
f._q=[];function e(i){f[i]=function(){f._q.push([i].concat(Array.prototype.slice.call(arguments,0)))}}
13-
var c=["init","logEvent","setUserId","setGlobalUserProperties","setVersionName","setDomain"];
13+
var c=["init","logEvent","setUserId","setUserProperties","setVersionName","setDomain","setGlobalUserProperties"];
1414
for(var d=0;d<c.length;d++){e(c[d])}h.amplitude=f})(window,document);
1515

1616
amplitude.init("YOUR_API_KEY_HERE");
@@ -43,15 +43,15 @@ You can also add the user ID as an argument to the `init` call:
4343

4444
You can attach additional data to any event by passing a Javascript object as the second argument to `logEvent`:
4545

46-
var customProperties = {};
47-
customProperties.key = "value";
48-
amplitude.logEvent("EVENT_IDENTIFIER_HERE", customProperties);
46+
var eventProperties = {};
47+
eventProperties.key = "value";
48+
amplitude.logEvent("EVENT_IDENTIFIER_HERE", eventProperties);
4949

50-
To add properties that are tracked in every event, you can set global properties for a user:
50+
To add properties that are tracked in every event, you can set properties for a user:
5151

52-
var globalProperties = {};
53-
globalProperties.key = "value";
54-
amplitude.setGlobalUserProperties(globalProperties);
52+
var userProperties = {};
53+
userProperties.key = "value";
54+
amplitude.setUserProperties(userProperties);
5555

5656
# Configuration Options #
5757

amplitude-1.2-min.js

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

0 commit comments

Comments
 (0)