Contents:
1. Access Your Amplitude API KEY
Go to your Amplitude project
Navigate to Settings > OrganizationSettings > Projects and click the name of the project you’d like to view or edit.
Find the API Key and copy it
2.Basic setup
Open the analytics section, locate amplitude analytics, and click "Add".
For a basic setup you can simply input your Amplitude API key into the designated field for quick setup.
3.1 Advanced setup.
If you'd rather configure it using script manually, choose the "Advanced settings" option.
Get the Amplitude script:
<!-- START Load Amplitude Tracking -->
<script type="text/javascript">
!function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:{}};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var r=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},o=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))}}},i=function(e){for(var t=0;t<m.length;t++)o(e,m[t],!1);for(var n=0;n<g.length;n++)o(e,g[n],!0)};n.invoked=!0;var u=t.createElement("script");u.type="text/javascript",u.integrity="sha384-x0ik2D45ZDEEEpYpEuDpmj05fY91P7EOZkgdKmq4dKL/ZAVcufJ+nULFtGn0HIZE",u.crossOrigin="anonymous",u.async=!0,u.src="https://cdn.amplitude.com/libs/analytics-browser-2.0.0-min.js.gz",u.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var a=t.getElementsByTagName("script")[0];a.parentNode.insertBefore(u,a);for(var c=function(){return this._q=[],this},p=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],l=0;l<p.length;l++)r(c,p[l]);n.Identify=c;for(var d=function(){return this._q=[],this},f=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],v=0;v<f.length;v++)r(d,f[v]);n.Revenue=d;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];i(n),n.createInstance=function(e){return n._iq[e]={_q:[]},i(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
amplitude.init('YOUR_API_KEY');
</script>
<!-- END Load Amplitude Tracking -->
Replace the placeholder "YOUR_API_KEY" in the script with your actual Amplitude API key. This key should be the one you've saved from your Amplitude project's settings page. Paste that script in the "BODY" and click "Save Web analytics"
3.2 Advanced setup for Tracking with Cookies policies:
Click on "Use Cookies Check". The required script will be added automatically.
Substitute YOUR_AMPLITUDE_ID in the script with your Amplitude API key. Be sure to copy this key from your Amplitude project's settings page.
Click on "Save Web Analytics".
Don't forget to Update your Web Onboarding