You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* All page views are now tracked by simple analytics */
46
46
```
@@ -64,3 +64,5 @@ Include this line at the end of your `<body>`
64
64
## View the source
65
65
66
66
You can view the source code of this plugin on [GitHub](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics)
67
+
68
+
If you encounter issues, don't hesitate to contact us via [our support channels](https://simpleanalytics.com/contact?ref={{ site.hostname }}).
You can embed our script in Cloudflare using [Cloudflare Apps](https://www.cloudflare.com/apps/simpleanalytics). On this page we will explain how to use this feature and help you installing the Simple Analytics app on Cloudflare.
12
+
13
+
Follow these steps to add Simple Analytics to your website:
14
+
15
+
1. Go to the <ahref="https://www.cloudflare.com/apps/simpleanalytics"target="_blank">Simple Analytics app on Cloudflare</a>
16
+
1. Make sure you are logged in
17
+
1. Click on **Preview on your site**:
18
+
19
+

20
+
21
+
1. You can customize some settings like [recording DNT users](/dnt), a [custom domain](/bypass-ad-blockers), [track events](/events), or enabling [hash navigation](/hash-mode). Once you're done click the button **Finish installing onto your site**:
22
+
23
+

24
+
25
+
1. Next click on the domain where you want to add Simple Analytics on:
26
+
27
+

28
+
29
+
1. Next click on **Install on all pages**:
30
+
31
+

32
+
33
+
1. Next click on **Continue** (we don't use your email):
34
+
35
+

36
+
37
+
1. On the next page you will see the Simple Analytics app installed:
38
+
39
+

40
+
41
+
If you encounter issues, don't hesitate to contact us via [our support channels](https://simpleanalytics.com/contact?ref={{ site.hostname }}).
Copy file name to clipboardExpand all lines: _docs/20_script/custom.md
+13-12
Original file line number
Diff line number
Diff line change
@@ -21,30 +21,31 @@ We make this work by overwriting the native `pushState`-function of the browser.
21
21
```js
22
22
// We check if the browser supports pushState
23
23
if (history.pushState&&Event&& dispatchEvent) {
24
-
25
24
// We create a listener based on the original browser feature
26
25
varstateListener=function(type) {
27
-
var orig = history[type]
26
+
var orig = history[type];
28
27
returnfunction() {
29
-
var rv =orig.apply(this, arguments)
30
-
varevent=newEvent(type)
31
-
event.arguments=arguments
32
-
dispatchEvent(event)
33
-
return rv
34
-
}
35
-
}
28
+
var rv =orig.apply(this, arguments);
29
+
varevent=newEvent(type);
30
+
event.arguments=arguments;
31
+
dispatchEvent(event);
32
+
return rv;
33
+
};
34
+
};
36
35
37
36
// We connect our own created a listener to the pushState feature
38
-
history.pushState=stateListener('pushState')
37
+
history.pushState=stateListener("pushState");
39
38
40
39
// Now we can listen for pushState events and keep the original feature of the browser working
41
-
window.addEventListener('pushState', function() {
40
+
window.addEventListener("pushState", function() {
42
41
// Here we trigger the page view
43
-
})
42
+
});
44
43
}
45
44
```
46
45
47
46
You can read our source code [on GitHub](https://github.com/simpleanalytics/scripts/blob/4ad5c1b6cb4c42ae2e483dc43a578e25399d53a4/src/default.js#L120-L137).
48
47
49
48
</div>
50
49
</details>
50
+
51
+
If you encounter issues, don't hesitate to contact us via [our support channels](https://simpleanalytics.com/contact?ref={{ site.hostname }}).
Copy file name to clipboardExpand all lines: _docs/20_script/hash.md
+2
Original file line number
Diff line number
Diff line change
@@ -18,3 +18,5 @@ To allow the script to detect those hash changes you can add `data-mode="hash"`
18
18
```
19
19
20
20
This way the Simple Analytics script knows it should detect hash changes and records them as page views. We still drop everything after the question mark, but we keep the hash.
21
+
22
+
If you encounter issues, don't hesitate to contact us via [our support channels](https://simpleanalytics.com/contact?ref={{ site.hostname }}).
Copy file name to clipboardExpand all lines: _docs/20_script/wix.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,11 @@ Follow these steps to add Simple Analytics to your website:
17
17
1. Go to [Settings in your site's dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Manage%20Settings&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https://www.wix.com/dashboard/{{metaSiteId}}/manage-website).
18
18
1. Click the **Tracking & Analytics** menu item under **Settings**.
19
19
20
-

20
+

21
21
22
22
1. Click **+ New Tool** and select **Custom** from the dropdown.
23
23
24
-

24
+

25
25
26
26
1. Enter your custom code you can copy from [how to add our script](/script).
27
27
1. Select the relevant domain. _Note: This option will appear only if you have multiple domains._
@@ -31,3 +31,5 @@ Follow these steps to add Simple Analytics to your website:
31
31
1. Click **Apply**.
32
32
33
33
Read more on the [WIX docs](https://support.wix.com/en/article/embedding-custom-code-to-your-site).
34
+
35
+
If you encounter issues, don't hesitate to contact us via [our support channels](https://simpleanalytics.com/contact?ref={{ site.hostname }}).
0 commit comments