Add more tracking features
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 534
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 45
Description
Page View (`frappe.website.doctype.web_page_view.web_page_view.make_view_log`) is already great and a lot of things can be built on top of it through (mere) reports, such as:
- [Funnels](https://plugins.matomo.org/Funnels)
- [User Flows](https://plugins.matomo.org/UsersFlow)
- [AB Test Performance](https://plugins.matomo.org/AbTesting)
- [Cohorts](https://plugins.matomo.org/Cohorts)
And with more integration with the rest of ERPNext, such as revenue data, even:
- [Multichannel Conversion Attribution](https://plugins.matomo.org/MultiChannelConversionAttribution)
Others would require more analytical record, such as:
- [Form Analytics](https://plugins.matomo.org/FormAnalytics) — _Form Analytics_ Doctype gathering statistics on Frappe Forms
- [Media Analytics](https://plugins.matomo.org/MediaAnalytics) — _Media Analytics_ Doctype gathering statistics on HTML5 `video` or `audio` tags
Other than that, typical tracking events, in addition to Page View, are `CheckoutItems`, `Checkout` (i.e. typically the definition of a "conversion"). See for example [this matomo help article for a good enough hands-on understanding of tracking events](https://matomo.org/faq/reports/advanced-manually-tracking-ecommerce-actions-in-matomo/).
These events are also very relevant for the so called _Conversion API_ s of this world (Meta, TikTok, Google, Microsoft) which they use to increase the effectiveness of marketing campaigns via AI-backed continuous improvement models.
A _Page Analytics Event_ could catch these whenever the user defines something like this on the respective action (e.g. click event of a button):
```js
// entire thing automatically seeded in the builder UI?
frappe.call("frappe.website.doctype.web_page_event.web_page_event.make_event_log", {
name: this.analytics_event_name, // automatically seeded in the builder UI?
referrer: document.referrer,
browser: browser.name,
version: browser.version,
user_tz: Intl.DateTimeFormat().resolvedOptions().timeZone,
source: query_params.source,
medium: query_params.medium,
campaign: query_params.campaign,
visitor_id: result.visitorId,
... // maybe more
})
```
On the backend, a combined `Analytics Settings` could then manage the mappings of the available event data to the various _Conversions API_ (Meta, TikTok, etc), as well as the credentials to push these data points to the campaign platform for AI-based campaign self-improvement.
I think that's a viable, out-of-current-builder-capability perspective and gameplan on how to bring this feature on-par quickly and cheaply with some of the industry leaders (such as Matomo or Google Analytics 4 / Google Tag Manager with server-side tagging). All the pieces are already in place, just needs connecting them.
cc @rmehta
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.