Skip to content

Commit

Permalink
Update web snippet to use prod link
Browse files Browse the repository at this point in the history
This updates the Web Page installation instructions to use the prod
url in the script tag rather than the dev cdn.
  • Loading branch information
philipcolejohnson committed Apr 25, 2024
1 parent 7b8d039 commit f07e888
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/browser/web-apps/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This method supports any String-based identifier.
appFit.identifyUser("USER_ID");
```

Setting this identifier to null will remove user tracking from all events going forward.
Setting this identifier to `undefined` will remove user tracking from all events going forward.

```javascript
appFit.identifyUser();
Expand Down
58 changes: 7 additions & 51 deletions docs/browser/web-pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,10 @@ The JavaScript SDK allows you to drop-in analytic tracking, direct to your AppFi

```html
<script>
(window.AppFit = {
cache: {},
trackEvent: (e, t) => (
window.AppFit.cache || (window.AppFit.cache = {}),
window.AppFit.cache.events || (window.AppFit.cache.events = []),
window.AppFit.cache.events.push({ eventName: e, payload: t }),
Promise.resolve()
),
identifyUser(e) {
window.AppFit.cache || (window.AppFit.cache = {}),
(window.AppFit.cache.identity = e);
},
}),
(window.startAppFit = (e) => {
window.AppFit.apiKey = e;
var t = document.createElement("script");
(t.type = "module"),
(t.src = "https://d1433kipn7zjh1.cloudfront.net/appfit.js");
var p = document.createElement("script");
(p.noModule = !0),
(p.src = "https://d1433kipn7zjh1.cloudfront.net/appfit-legacy.js");
var i = document.getElementsByTagName("script")[0];
i.parentNode.insertBefore(t, i), i.parentNode.insertBefore(p, i);
}),
window.startAppFit("API_KEY");
</script>
window.AppFit={cache:{},trackEvent:(e,t)=>(window.AppFit.cache||(window.AppFit.cache={}),window.AppFit.cache.events||(window.AppFit.cache.events=[]),window.AppFit.cache.events.push({eventName:e,payload:t}),Promise.resolve()),identifyUser(e){window.AppFit.cache||(window.AppFit.cache={}),window.AppFit.cache.identity=e}},window.startAppFit=e=>{window.AppFit.apiKey=e;var t=document.createElement("script");t.type="module",t.src="https://d1433kipn7zjh1.cloudfront.net/browser-sdk/appfit.js";var p=document.createElement("script");p.noModule=!0,p.src="https://d1433kipn7zjh1.cloudfront.net/browser-sdk/appfit-legacy.js";var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(t,i),i.parentNode.insertBefore(p,i)},
window.startAppFit("YOUR_WRITE_KEY");
</script>
```

2. Be sure to **replace `API_KEY` with your API secret**, leaving in the quotation marks. Your API Key can be obtained from your AppFit Dashboard.
Expand All @@ -52,31 +30,9 @@ The JavaScript SDK allows you to drop-in analytic tracking, direct to your AppFi
<!-- Pasted tag -->
<!---------------->
<script>
(window.AppFit = {
cache: {},
trackEvent: (e, t) => (
window.AppFit.cache || (window.AppFit.cache = {}),
window.AppFit.cache.events || (window.AppFit.cache.events = []),
window.AppFit.cache.events.push({ eventName: e, payload: t }),
Promise.resolve()
),
identifyUser(e) {
window.AppFit.cache || (window.AppFit.cache = {}),
(window.AppFit.cache.identity = e);
},
}),
(window.startAppFit = (e) => {
window.AppFit.apiKey = e;
var t = document.createElement("script");
(t.type = "module"),
(t.src = "https://d1433kipn7zjh1.cloudfront.net/appfit.js");
var p = document.createElement("script");
(p.noModule = !0),
(p.src = "https://d1433kipn7zjh1.cloudfront.net/appfit-legacy.js");
var i = document.getElementsByTagName("script")[0];
i.parentNode.insertBefore(t, i), i.parentNode.insertBefore(p, i);
}),
window.startAppFit("API_KEY");
window.AppFit={cache:{},trackEvent:(e,t)=>(window.AppFit.cache||(window.AppFit.cache={}),window.AppFit.cache.events||(window.AppFit.cache.events=[]),window.AppFit.cache.events.push({eventName:e,payload:t}),Promise.resolve()),identifyUser(e){window.AppFit.cache||(window.AppFit.cache={}),window.AppFit.cache.identity=e}},window.startAppFit=e=>{window.AppFit.apiKey=e;var t=document.createElement("script");t.type="module",t.src="https://d1433kipn7zjh1.cloudfront.net/browser-sdk/appfit.js";var p=document.createElement("script");p.noModule=!0,p.src="https://d1433kipn7zjh1.cloudfront.net/browser-sdk/appfit-legacy.js";var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(t,i),i.parentNode.insertBefore(p,i)},
window.startAppFit("API_KEY");
</script>

<!------------------->
Expand Down

0 comments on commit f07e888

Please sign in to comment.