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
We try to make installing Simple Analytics as simple as possible. We want privacy to be accessible as possible. We don't require the need of a developer if you use any of the following tools.
10
+
We try to make installing Simple Analytics as simple as possible. We want privacy to be accessible as possible. We don't require the need for a developer if you use any of the following tools.
11
11
12
12
Read our guides on how to install Simple Analytics on:
13
13
@@ -25,19 +25,20 @@ Read our guides on how to install Simple Analytics on:
25
25
26
26
## Framework plugins
27
27
28
-
For most frameworks you can just include the script. We track page views in a magic way so you don't have to change your app code. [Read on how we do that](/trigger-custom-page-views). For some we got requests to create a plugin for them.
28
+
For most frameworks, you can include the script. We magically track page views, so you don't have to change your app code. [Read on how we do that](/trigger-custom-page-views). For some, we got requests to create a plugin for them.
29
29
30
30
Get our official plugins for these frameworks:
31
31
32
-
-[Ruby on Rails](https://rubygems.org/gems/simple_analytics_rails) <small>(source on [GitHub](https://github.com/simpleanalytics/rubyonrails-plugin#readme))</small>
33
-
-[Gatsby](https://www.npmjs.com/package/gatsby-plugin-simple-analytics) <small>(source on [GitHub](https://github.com/simpleanalytics/gatsby-plugin#readme))</small>
34
-
-[Vue](https://www.npmjs.com/package/simple-analytics-vue) <small>(source on [GitHub](https://github.com/simpleanalytics/vue-plugin#readme))</small>
35
-
-[VuePress](https://www.npmjs.com/package/vuepress-plugin-simple-analytics) <small>(source on [GitHub](https://github.com/simpleanalytics/vuepress-plugin#readme))</small>
-[Ruby on Rails](/install-simple-analytics-with-ruby-on-rails) <small>(source on [GitHub](https://github.com/simpleanalytics/rubyonrails-plugin#readme))</small>
34
+
-[Gatsby](/install-simple-analytics-with-gatsby) <small>(source on [GitHub](https://github.com/simpleanalytics/gatsby-plugin#readme))</small>
35
+
-[Vue](/install-simple-analytics-with-vue) <small>(source on [GitHub](https://github.com/simpleanalytics/vue-plugin#readme))</small>
36
+
-[VuePress](/install-simple-analytics-with-vuepress) <small>(source on [GitHub](https://github.com/simpleanalytics/vuepress-plugin#readme))</small>
-[Gridsome](https://gridsome.org/plugins/gridsome-plugin-simple-analytics) <small>(source on [GitHub](https://github.com/simpleanalytics/gridsome-plugin#readme))</small>
38
-
-[Django](https://pypi.org/project/simpleanalytics/) <small>(source on [GitHub](https://github.com/simpleanalytics/django-plugin#readme))</small>
38
+
-[Gridsome](/install-simple-analytics-with-gridsome) <small>(source on [GitHub](https://github.com/simpleanalytics/gridsome-plugin#readme))</small>
39
+
-[Django](/install-simple-analytics-with-django) <small>(source on [GitHub](https://github.com/simpleanalytics/django-plugin#readme))</small>
39
40
-[Analytics library](/install-simple-analytics-via-analytics-package) <small>(source on [GitHub](https://github.com/DavidWells/analytics/tree/master/packages/analytics-plugin-simple-analytics))</small>
You can install Simple Analytics using the opensource Analytics library ([website](https://getanalytics.io), [npm](https://www.npmjs.com/package/analytics)). It's a pluggable library designed as an abstraction layer to easily customize the analytics requirements of your app.
8
+
You can install Simple Analytics using the open-source Analytics library ([website](https://getanalytics.io), [npm](https://www.npmjs.com/package/analytics)). It's a pluggable library designed as an abstraction layer to customize your app's analytics requirements easily.
The Analytics library works with any frontend framework including `react`, `vue`, `angular` or static `html`.
18
+
The Analytics library works with any frontend framework, including `react`, `vue`, `angular` or static `html`.
20
19
21
20
To use it:
22
21
23
22
1. Import the `analytics` library and `analytics-plugin-simple-analytics`
24
23
2. Initialize the `analytics` library
25
24
3. Page views get tracked automatically
26
-
4. Include the nonjavascript fallback in your `html`
25
+
4. Include the non-javascript fallback in your `html`
27
26
28
27
Example code:
29
28
@@ -45,17 +44,18 @@ const analytics = Analytics({
45
44
46
45
Make sure to include this file in the entry point of your application. This will ensure the Analytics library and Simple Analytics scripts load correctly.
47
46
48
-
When the Analytics library initialized it will automatically load the simple analytics script onto the page.
47
+
When the Analytics library is initialized it will automatically load the simple analytics script onto the page.
49
48
50
-
For additional instructions on how to use with other frontend frameworks, checkout the [Analytics library docs](https://getanalytics.io/tutorial/getting-started/)
49
+
For additional instructions on how to use with other frontend frameworks, check out the [Analytics library docs](https://getanalytics.io/tutorial/getting-started/)
51
50
52
-
## Include Non JS enabled browser fallback
51
+
## Include non-JS enabled browser fallback
53
52
54
-
Remember to include the `noscript` image tag in your HTML for JSdisabled browsers.
53
+
Remember to include the `noscript` image tag in your HTML for JS-disabled browsers.
It tracks page views with support for `pushState` navigation. It sends the data to [Simple Analytics](https://simpleanalytics.com) and it will be available in your dashboard. You need to have a paid subscription for it to work.
17
+
18
+
## How to use
19
+
20
+
1. Add our plugin to `gatsby-config.js`
21
+
22
+
```js
23
+
plugins: [
24
+
{
25
+
resolve:"gatsby-plugin-simple-analytics",
26
+
options: {
27
+
trackPageViews:true,
28
+
},
29
+
},
30
+
];
31
+
```
32
+
33
+
1. If you want to set a custom domain, use this config:
34
+
35
+
```js
36
+
plugins: [
37
+
{
38
+
resolve:"gatsby-plugin-simple-analytics",
39
+
options: {
40
+
domain:"custom.example.com",
41
+
eventsGlobal:"sa",
42
+
events:true,
43
+
trackPageViews:true,
44
+
ignorePages: ["pathname"],
45
+
},
46
+
},
47
+
];
48
+
```
49
+
50
+
[Read our docs](https://docs.simpleanalytics.com/bypass-ad-blockers) on the custom domain feature.
51
+
52
+
## Use with Confirmic
53
+
54
+
[Confirmic](https://confirmic.com/) provides a privacy-by-design API to ethically manage your users' data. It's pretty cool.
55
+
56
+
If you want to use it with Confirmic's `data-micropolicy` use this config:
You can also optionally specify a custom domain to bypass ad blockers. Read more about this in [our documentation](https://docs.simpleanalytics.com/bypass-ad-blockers).
It will use the `afterInteractive` strategy to load the script. From the docs:
39
+
40
+
> For scripts that can fetch and execute after the page is interactive, such as tag managers and analytics. These scripts are injected on the client-side and will run after hydration.
0 commit comments