Skip to content

Commit 9db6553

Browse files
committed
Describe automatically attached properties
1 parent 6d3ae8f commit 9db6553

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/custom-event-goals.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,33 @@ Once you’ve made the necessary changes, simply click "Update goal," and your u
209209

210210
Custom properties can be attached to events to capture dynamic elements and to further break down goal conversions. You can use custom properties to create your custom metrics to collect and analyze data that Plausible doesn't automatically track. [Learn more here](/custom-props/for-custom-events).
211211

212+
### Automatically attached properties
213+
214+
#### `url`
215+
216+
For clicks on links (`<a>` elements) tagged with `plausible-event-name=...`, we automatically track where the link is pointing (its `href` property).
217+
218+
:::note
219+
This property is not automatically attached when the tagged `<a>` element is within `<svg>` tags.
220+
:::
221+
222+
There's no additional processing on our side for this value and the value of `href` is stored in full. If you're tagging links that contain sensitive data, you may want to stop this value from being sent. You can do so by providing the following `transformRequest` option when initializing the tracker.
223+
224+
```javascript
225+
function omitAutomaticUrlProperty(payload) {
226+
if (payload.p.url) {
227+
delete payload.p.url
228+
}
229+
return payload
230+
}
231+
232+
plausible.init({
233+
transformRequest: omitAutomaticUrlProperty
234+
// ... your other init options
235+
})
236+
```
237+
238+
212239
### Monetary values to track ecommerce revenue
213240

214241
You can also send dynamic monetary values alongside custom events to track revenue attribution. Here's how to set up the [ecommerce revenue tracking](ecommerce-revenue-tracking.md).

0 commit comments

Comments
 (0)