Skip to content

Commit

Permalink
Add script type to snippet script tags
Browse files Browse the repository at this point in the history
This is just to make it more clear to a browsers

<!-- ps-id: ef825f12-d723-4ed6-951d-d1af89ce9afb -->
  • Loading branch information
philipcolejohnson committed Apr 25, 2024
1 parent f07e888 commit 2101277
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/browser/web-pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The JavaScript SDK allows you to drop-in analytic tracking, direct to your AppFi
1. Install AppFit by pasting the following `<script>` tag into your webpage between the `<head>` tags.

```html
<script>
<script type="text/javascript">
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");
Expand All @@ -29,7 +29,7 @@ The JavaScript SDK allows you to drop-in analytic tracking, direct to your AppFi
<!---------------->
<!-- Pasted tag -->
<!---------------->
<script>
<script type="text/javascript">
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");
Expand All @@ -38,7 +38,7 @@ The JavaScript SDK allows you to drop-in analytic tracking, direct to your AppFi
<!------------------->
<!-- Example usage -->
<!------------------->
<script>
<script type="text/javascript">
window.AppFit.trackEvent("screen_viewed", {
screen: window.location.pathname,
});
Expand Down
2 changes: 1 addition & 1 deletion docs/browser/web-pages/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ See the following for specific use cases.
This event will record a user visiting a webpage.

```html
<script>
<script type="text/javascript">
window.AppFit.trackEvent("screen_viewed", { screen: window.location.pathname })
</script>
```

0 comments on commit 2101277

Please sign in to comment.