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
Copy file name to clipboardExpand all lines: src/connections/destinations/catalog/matomo/index.md
+20-22Lines changed: 20 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,31 @@ id: 54521fda25e721e32a72eee7
7
7
[Matomo](https://matomo.org/){:target="_blank"}, formerly Piwik, is the leading open source web analytics platform that gives you valuable insights into your website's visitors, your marketing campaigns and much more, so you can optimize your strategy and online experience of your visitors.
8
8
9
9
Segment’s Matomo destination code is open-source and can be viewed on GitHub:
2. Search for "Matomo" in the Catalog, select it, and choose which of your sources to connect the destination to. Note the source must be sending events using our JavaScript library Analytics.js.
15
+
2. Search for "Matomo" in the Catalog, select it, and choose which of your sources to connect the destination to. Note the source must be sending events using the Segment JavaScript library Analytics.js.
18
16
3. In the destination settings, enter your Site ID. You can find your Site ID in your Matomo snippet.
19
-
4. In the destination settings, enter your Server URL. You can find your Server URL in your snippet, we will append /matomo.php to the URL automatically.
20
-
5. When you enable Matomo in your Segment settings, Segment's CDN is updated within 45 minutes. Once that happens, Segment asynchronously loads `matomo.js` on your page whenever it is loaded. This means you should remove Matomo's snippet from your page.
17
+
4. In the destination settings, enter your Server URL. You can find your Server URL in your snippet. Segment automatically appends /matomo.php to the URL.
18
+
5. When you enable Matomo in your Segment settings, Segment's CDN is updated within 45 minutes. Once that happens, Segment asynchronously loads `matomo.js` on your page whenever it is loaded. This means you should remove Matomo's snippet from your page.
21
19
22
20
## Page
23
21
If you're not familiar with the Segment Specs, take a look to understand what the [Page method](/docs/connections/spec/page/) does. An example call would look like:
24
22
25
23
```js
26
24
analytics.page();
27
25
```
28
-
29
-
Our Page method triggers a call to Matomo's `trackPageView` method.
26
+
The Page method triggers a call to Matomo's `trackPageView` method.
30
27
31
28
## Identify
32
29
If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](/docs/connections/spec/identify/) does. An example call would look like:
33
30
34
31
```js
35
32
analytics.identify('97980cfea0068');
36
33
```
37
-
Our Identify method triggers a call to Matomo's `setUserId` method and will send the `userId` to Matomo.
34
+
The Identify method triggers a call to Matomo's `setUserId` method and will send the `userId` to Matomo.
38
35
39
36
## Track
40
37
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does. An example call would look like:
@@ -43,9 +40,9 @@ If you're not familiar with the Segment Specs, take a look to understand what th
43
40
analytics.track('Logged In');
44
41
```
45
42
46
-
We'll record a Matomo event whenever you make a `track` call.
43
+
Segement records a Matomo event whenever you make a `track` call.
47
44
48
-
For the example above, these event attributes are sent to Matomo:
45
+
In the example, these event attributes are sent to Matomo:
49
46
50
47
<table>
51
48
<tr>
@@ -58,7 +55,7 @@ For the example above, these event attributes are sent to Matomo:
58
55
</tr>
59
56
</table>
60
57
61
-
Find below another Track example, this time with all the available Matomo event parameters:
58
+
See the following Track example, this time with all the available Matomo event parameters:
That call will create a Matomo Event with these attributes:
68
+
That call creates a Matomo Event with these attributes:
72
69
73
70
<table>
74
71
<tr>
@@ -89,17 +86,18 @@ That call will create a Matomo Event with these attributes:
89
86
</tr>
90
87
</table>
91
88
92
-
For **Event Value** you can name the event property `value` or `revenue`. We'll look for `value` first, then fall back to `revenue`.
89
+
For **Event Value**, you can name the event property `value` or `revenue`. Segment looks for `value` first, then fall back to `revenue`.
93
90
94
-
## Best Practices
91
+
## Best practices
95
92
96
-
Matomo allows you to set [custom variables](http://matomo.org/docs/custom-variables/){:target="_blank"} with your pageviews and events. With Segment, you can set page-scoped custom variables with any `track` call you make with analytics.js.
93
+
Matomo lets you set [custom variables](http://matomo.org/docs/custom-variables/){:target="_blank"} with your pageviews and events. With Segment, you can set page-scoped custom variables with any Track call you make with analytics.js.
97
94
98
-
Since these custom variables must be mapped to an index you define, which can change from call to call, the only way we can support these custom variables with full flexibility is to allow you to pass your map in the `context.Matomo.customVars` dictionary of each call.
95
+
Since these custom variables must be mapped to an index you define, which can change from call to call, the only way that Segment can support these custom variables with full flexibility is to allow you to pass your map in the `context.Matomo.customVars` dictionary of each call.
99
96
100
-
To take advantage of this feature, your `track` calls should look like this:
97
+
To take advantage of this feature, your Track calls should look like this:
101
98
102
-
> **Note** The destination's name is still "piwik" in the JSON for these calls.
99
+
> info ""
100
+
> The destination's name is still "piwik" in the JSON for these calls.
103
101
104
102
```js
105
103
analytics.track('event', {
@@ -117,6 +115,6 @@ analytics.track('event', {
117
115
```
118
116
119
117
### Goals
120
-
If you want to flag specific events as Matomo Goals you can do so by mapping those events in your Segment Source Destinations page under Matomo Settings.
118
+
If you want to flag specific events as Matomo Goals, you can do so by mapping those events in your Segment Source Destinations page under Matomo Settings.
121
119
122
-
Fill in the event on the left and the Goal ID from Matomo on the right. Then every time the event happens we'll fire Matomo's `trackGoal` method.
120
+
Fill in the event on the left and the Goal ID from Matomo on the right. Then every time the event happens Segment fires Matomo's `trackGoal` method.
0 commit comments