|
1 | | -# simpleanalytics for Django |
| 1 | +# Simple Analytics for Django |
| 2 | + |
2 | 3 | Want privacy friendly analytics for Django? You're at the right place. |
3 | 4 |
|
| 5 | +> You need an account [on Simple Analytics](https://simpleanalytics.com) to see your stats collected by this plugin. |
| 6 | +
|
4 | 7 | # Installing it |
| 8 | + |
5 | 9 | Install the plugin: |
6 | 10 |
|
7 | 11 | `pip install django-simpleanalytics` |
8 | 12 |
|
9 | 13 | # Using it |
| 14 | + |
10 | 15 | Add the package to the `INSTALLED_APPS`: |
11 | | -```python |
| 16 | +```python |
12 | 17 | INSTALLED_APPS = [ |
13 | 18 | ..., |
14 | 19 | simpleanalytics, |
15 | 20 | ] |
16 | 21 | ``` |
17 | 22 |
|
18 | 23 | Next use the `templatetag` in your template: |
19 | | -``` |
| 24 | + |
| 25 | +``` |
20 | 26 | <!DOCTYPE html> |
21 | 27 | {% load staticfiles simpleanalytics_tags %} |
22 | 28 | <html> |
@@ -60,25 +66,25 @@ This app has four templatetags: |
60 | 66 | - simpleanalytics_sync |
61 | 67 | - simpleanalytics_async |
62 | 68 | - simpleanalytics_noscript_block |
63 | | -- simpleanalytics_noscript_img |
| 69 | +- simpleanalytics_noscript_img |
64 | 70 |
|
65 | 71 | `simpleanalytics_sync` converts to a plain `<script>` tag without the `async` |
66 | | -keyword. |
| 72 | +keyword. |
67 | 73 |
|
68 | 74 | `simpleanalytics_async` converts to a plain `<script>` tag with the `async` |
69 | | -keyword. |
| 75 | +keyword. |
70 | 76 |
|
71 | | -`simpleanalytics_noscript_block` converts to an `<noscript>` block which |
72 | | -includes an `img` element which is used to load the image. Use this when you |
73 | | -don't have and don't need a `<noscript>` block on your page at all. |
| 77 | +`simpleanalytics_noscript_block` converts to an `<noscript>` block which |
| 78 | +includes an `img` element which is used to load the image. Use this when you |
| 79 | +don't have and don't need a `<noscript>` block on your page at all. |
74 | 80 |
|
75 | 81 | `simpleanalytics_noscript_img` converts to an `<img>` tag which src points to |
76 | 82 | the hello.img. Use this when you're using a `<noscript>` block and you want to |
77 | 83 | add privacy friendly stats to your page. |
78 | 84 |
|
79 | 85 | # Compatibility |
80 | 86 |
|
81 | | -Tested on Django 2.2, but we think you should be able to run on any recent |
| 87 | +Tested on Django 2.2, but we think you should be able to run on any recent |
82 | 88 | Django deployment. Please file an issue when it doesn't. |
83 | 89 |
|
84 | 90 |
|
0 commit comments