The Amp Devcenter Test Developer Hub

Welcome to the Amp Devcenter Test developer hub. You'll find comprehensive guides and documentation to help you start working with Amp Devcenter Test as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    


npm versionnpm version

SDK Installation

You can install the JavaScript SDK using a small snippet of code which you paste on your site to asynchronously load the SDK. Or alternatively you can install the npm module and embed the SDK directly into your product.

Installing the Snippet

On every page that you want to install Amplitude analytics, paste the code snippet just before the </head> tag.

<script type="text/javascript">
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
console.log("[Amplitude] Error: could not load SDK")}}
;var i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)
;function s(e,t){e.prototype[t]=function(){
this._q.push([t].concat(,0)));return this}}
var o=function(){this._q=[];return this}
;var a=["add","append","clearAll","prepend","set","setOnce","unset"]
;for(var c=0;c<a.length;c++){s(o,a[c])}n.Identify=o;var u=function(){this._q=[]
;return this}
;var l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"]
;for(var p=0;p<l.length;p++){s(u,l[p])}n.Revenue=u
;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"]
;function v(e){function t(t){e[t]=function(){
for(var n=0;n<d.length;n++){t(d[n])}}v(n);n.getInstance=function(e){
;if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};v(n._iq[e])}return n._iq[e]}


Replace API_KEY with the API Key given to you. You can find your project's API Key in your project's Settings page.

Installing with npm or yarn

If you are using npm, use the following command:

npm install amplitude-js

If you are using yarn, use the following command:

yarn add amplitude-js

You will now be able to import amplitude in your project:

import amplitude from 'amplitude-js';

Debugging Tools

If you develop on chrome, we also recommend you use the Amplitude Instrumentation Explorer from the Chrome Web Store. It allows you to explore and debug your Amplitude instrumentation as you interact with your site.

Content Security Policy (CSP)

If your site uses a content security policy you will need to add to your connect-src policy to send data to amplitude:


If you load the SDK using the snippet, you will also need to add to your script-src policy to be able to fetch the SDK.


Usage & Examples

Please see the SDK Usage & Examples page.

Need Help?

If you have any problems or issues over our SDK, feel free to create a github issue or submit a request on Amplitude Help.

Updated 9 days ago


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.