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
<imgclass="border"src="https://assets.simpleanalytics.com/docs/explained/platform-integration.png"alt="Simple Analytics integration in your platform" />
14
+
15
+
Usually it's just a user or team setting in your platform.
14
16
15
17
## Embed script
16
18
19
+
The only thing that's required, is enabling this script somewhere in the `<body>` (or `<head>`) of your platform when your user enables the *Simple Analytics Enabled* checkbox. They don't need to enter a website ID and don't need to create a Simple Analytics account before this checkbox can be enabled. We use the domain as an identifier.
*`<customer_subdomain>`* is the stable identifier you create for that site on day one. Keep it even if the user changes domains later. It's also the hostname the Simple Analytics users will see in their dashboard.
23
-
24
-
*`<affiliate-code>`* is a unique code you can get from us which we use to attach it to every hit so new sign ups are credited to your account.
26
+
-*`<customer_domain>`*(required) is the stable identifier you create for that site on day one. Usually this is `customerxxx.yourplatform.com`, or `customerdomain.com`. Keep it even if the user changes domains later. It's also the hostname the Simple Analytics users will see in their dashboard.
27
+
-*`<your-platform-name>`* (required) is a unique name of your platform (eg.: `netlify`, `partner.com`, `kennis.shop`). This helps us linking all domains to your platform. Allowing us to give your users tailored instructions.
28
+
-*`<affiliate-code>`* (optional) is a unique code you can get from us which we use to attach it to every hit so new sign ups are credited to your account. This is optional.
25
29
26
30
## Optional event tracking
27
31
32
+
This part is completely optional, but some users like it when implemented. You can track clicks on buttons, submitting of forms, or clicks on download links.
33
+
28
34
Add this helper once in `<head>`. You can include it for every customer. If the Simple Analytics script is not enabled the events remain in the browser and are ignored. When the script is enabled they are automatically sent to Simple Analytics servers.
29
35
30
36
```html
@@ -42,7 +48,9 @@ Front end events send with this function:
42
48
sa_event("click_signup");
43
49
```
44
50
45
-
Server side events:
51
+
<detailsmarkdown="1">
52
+
53
+
<summary>How to implement thisServer side</summary>
46
54
47
55
```bash
48
56
curl -X POST https://queue.simpleanalyticscdn.com/events \
@@ -56,11 +64,14 @@ curl -X POST https://queue.simpleanalyticscdn.com/events \
56
64
}'
57
65
```
58
66
67
+
</details>
68
+
59
69
## Testing
60
70
61
71
1. Spin up a test site.
62
72
2. Enable the checkbox.
63
-
3. Load a page and confirm hits appear in your Simple Analytics dashboard under the `affiliate-code` affiliate tab.
73
+
3. Visit the test site.
74
+
4. Check if there are requests to Simple Analytics in the Network tab of the Developer Tools.
0 commit comments