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: README.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,10 @@ Similar to `registerAttribute()` above but for metrics.
46
46
47
47
Allows you to define the Elasticsearch server URL directly.
48
48
49
+
**`ALTIS_ANALYTICS_LOG_QUERIES`**
50
+
51
+
Define as true to enable logging queries to the error log.
52
+
49
53
### Filters
50
54
51
55
The plugin provides a few hooks for you to control the default endpoint data and attributes recorded with events.
@@ -131,6 +135,9 @@ A user session covers every event recorded between opening the website and closi
131
135
-`ModelVersion`: Browser version.
132
136
-`Platform`: The device operating system.
133
137
-`PlatformVersion`: The operating system version.
138
+
-`Location`
139
+
-`Country`: The endpoint's country if known / available.
140
+
-`City`: The endpoint's city if known or available.
134
141
-`User`
135
142
-`UserAttributes`
136
143
- Any custom attributes associated with the user if known.
@@ -224,6 +231,28 @@ The output will look something like the following:
224
231
225
232
You can further trim the size of the returned response using the `filter_path` query parameter. For example if we're only interested in the stats aggregation we can set `filter_path=-aggregations.sessions` to remove it from the response.
226
233
234
+
## Audiences
235
+
236
+
Audiences are user-defined categories of users, based on conditions related to their analytics data.
237
+
238
+
Audiences allow for the creation of conditions to narrow down event queries or endpoints but also can be used for determining effects on the client side.
239
+
240
+
### Mapping Event Data
241
+
242
+
To enable the use of any event record data in the audience editor it needs to be mapped to a human readable label using the `Altis\Analytics\Audiences\register_field()` function:
243
+
244
+
```php
245
+
use function Altis\Analytics\Audiences\register_field;
In the above example the 1st parameter `endpoint.Location.City` represents the field in the event record to query against. Other examples include `attributes.utm_campaign` or `endpoint.User.UserAttibrutes.custom` for example.
253
+
254
+
The 2nd parameter is a human readable label for the audience field.
255
+
227
256
## Required Infrastructure
228
257
229
258
A specific infrastructure set up is required to use this plugin:
0 commit comments