Giter VIP home page Giter VIP logo

Comments (3)

blaggacao avatar blaggacao commented on August 25, 2024

List of Event Triggers available in my Matomo Instance's Tag Manager:

Clicks

  • All Download Clicks (left, middle or right click)
  • All Element Clicks (left, middle or right click)
  • All Link Clicks (left, midlle or right click)

Pageviews

  • DOM Ready
  • PageView
  • Window Loaded

User engagement

  • Element Visibility (when a specific element becomes visible)
  • Form Submit (when any form is sumbitted)
  • Full screen (when window goes or leaves full screen)
  • History Change (when the current url changes)
  • Scroll Reach (when a certain scroll position is reached)
  • User Interaction (configurable touche, move, scroll or mouse click event)
  • Window Leave ("about to leave", when user mouse moves outside the window)
  • Window Unload (just before the window is closed or user navigates to different page)

Others

  • Custom Event
  • JS Error (when a js error happens)
  • Timer (on a specific interval)

I imagine most of these could be thought of check-boxes in the builder UI on the respective components, something like "Enable Tracking".

from builder.

blaggacao avatar blaggacao commented on August 25, 2024

Here is a real live Matomo Tag Manager script

https://gist.github.com/blaggacao/fc8d33f7ba46ba4fa30e533146a114dd

I think the beauty of having this integrated into builder is that a lot of the bolt-on trigger logic won't be necessary because those triggers can just be included into the page source where ever it is desired. Server side push to Conversion APIs and others also makes the overhead of having external tool's client side procsessing obsolete. That is: instead of installing a Facebook Pixel tag, one would simply feed the data kraken server-to-server, directly from the back end (just as modern Google Tag Manager does in a cookieless [third-party] 2024 world).

What's a bit more interesting are the variables and internal data structures used. They might give us some clues as to what is UI configurable in matomo tag manager and what is actually tracked:

In a bit I'll be able to assess how Facebook Pixel plays into this to extract the exact correlation mechanism on how incoming platforms would express a "Click ID" or capture a "User Identity" [Possibly the finger-printed visitor ID is actually enough for most conversion APIs if enriched with some back-end user data such as email, address or IP]) 🤷

        window.MatomoTagManager.addContainer({
            "id": "fff...",
            "idsite": 1,
            "versionName": "",
            "revision": 0,
            "environment": "live",
            "tags": [{
                "id": 1,
                "type": "Matomo",
                "name": "fff......",
                "parameters": {
                    "matomoConfig": {
                        "name": "Matomo Configuration",
                        "type": "MatomoConfiguration",
                        "lookUpTable": [],
                        "defaultValue": "",
                        "parameters": {
                            "matomoUrl": "https:\/\/foobar.matomo.cloud",
                            "idSite": 1,
                            "enableLinkTracking": true,
                            "enableFormAnalytics": true,
                            "enableMediaAnalytics": true,
                            "enableFileTracking": false,
                            "enableCrossDomainLinking": false,
                            "crossDomainLinkingTimeout": "180",
                            "enableDoNotTrack": false,
                            "disablePerformanceTracking": false,
                            "enableJSErrorTracking": false,
                            "enableHeartBeatTimer": false,
                            "heartBeatTime": "15",
                            "trackAllContentImpressions": false,
                            "trackVisibleContentImpressions": false,
                            "disableCookies": false,
                            "requireConsent": false,
                            "requireCookieConsent": false,
                            "customCookieTimeOutEnable": false,
                            "customCookieTimeOut": "393",
                            "referralCookieTimeOut": "182",
                            "sessionCookieTimeOut": "30",
                            "setSecureCookie": false,
                            "cookieDomain": "",
                            "cookieNamePrefix": "_pk_",
                            "cookiePath": "",
                            "cookieSameSite": "Lax",
                            "disableBrowserFeatureDetection": false,
                            "domains": [],
                            "alwaysUseSendBeacon": false,
                            "disableAlwaysUseSendBeacon": false,
                            "userId": "",
                            "customDimensions": [],
                            "registerAsDefaultTracker": true,
                            "bundleTracker": true,
                            "jsEndpoint": "matomo.js",
                            "jsEndpointCustom": "custom.js",
                            "trackingEndpoint": "matomo.php",
                            "trackingEndpointCustom": "custom.php",
                            "appendToTrackingUrl": "",
                            "forceRequestMethod": false,
                            "requestMethod": "GET",
                            "requestContentType": "application\/x-www-form-urlencoded; charset=UTF-8",
                            "customRequestProcessing": ""
                        },
                        "Variable": "MatomoConfigurationVariable"
                    },
                    "trackingType": "pageview",
                    "idGoal": "",
                    "goalCustomRevenue": "",
                    "documentTitle": "",
                    "customUrl": "",
                    "isEcommerceView": false,
                    "productSKU": "",
                    "productName": "",
                    "categoryName": "",
                    "price": "",
                    "eventCategory": "",
                    "eventAction": "",
                    "eventName": "",
                    "eventValue": ""
                },
                "blockTriggerIds": [],
                "fireTriggerIds": [1],
                "fireLimit": "unlimited",
                "fireDelay": 0,
                "startDate": null,
                "endDate": null,
                "Tag": "MatomoTag"
            }],
            "triggers": [{
                "id": 1,
                "type": "PageView",
                "name": "PageView",
                "parameters": [],
                "conditions": [],
                "Trigger": "PageViewTrigger"
            }],
            "variables": [{
                "name": "MatomoConfiguration",
                "type": "MatomoConfiguration",
                "lookUpTable": [],
                "defaultValue": "",
                "parameters": {
                    "matomoUrl": "https:\/\/foobar.matomo.cloud",
                    "idSite": 1,
                    "enableLinkTracking": true,
                    "enableFormAnalytics": true,
                    "enableMediaAnalytics": true,
                    "enableFileTracking": false,
                    "enableCrossDomainLinking": false,
                    "crossDomainLinkingTimeout": "180",
                    "enableDoNotTrack": false,
                    "disablePerformanceTracking": false,
                    "enableJSErrorTracking": false,
                    "enableHeartBeatTimer": false,
                    "heartBeatTime": "15",
                    "trackAllContentImpressions": false,
                    "trackVisibleContentImpressions": false,
                    "disableCookies": false,
                    "requireConsent": false,
                    "requireCookieConsent": false,
                    "customCookieTimeOutEnable": false,
                    "customCookieTimeOut": "393",
                    "referralCookieTimeOut": "182",
                    "sessionCookieTimeOut": "30",
                    "setSecureCookie": false,
                    "cookieDomain": "",
                    "cookieNamePrefix": "_pk_",
                    "cookiePath": "",
                    "cookieSameSite": "Lax",
                    "disableBrowserFeatureDetection": false,
                    "domains": [],
                    "alwaysUseSendBeacon": false,
                    "disableAlwaysUseSendBeacon": false,
                    "userId": "",
                    "customDimensions": [],
                    "registerAsDefaultTracker": true,
                    "bundleTracker": true,
                    "jsEndpoint": "matomo.js",
                    "jsEndpointCustom": "custom.js",
                    "trackingEndpoint": "matomo.php",
                    "trackingEndpointCustom": "custom.php",
                    "appendToTrackingUrl": "",
                    "forceRequestMethod": false,
                    "requestMethod": "GET",
                    "requestContentType": "application\/x-www-form-urlencoded; charset=UTF-8",
                    "customRequestProcessing": ""
                },
                "Variable": "MatomoConfigurationVariable"
            }]
        }, Templates);

from builder.

blaggacao avatar blaggacao commented on August 25, 2024
List of Variales from Matomo.

They are kind of the the "building blocks" for marketeer's programming via the "Tag Manager UI". As a developer, I understand that they are pretty much equivalent to the injection of a let foo = ...; block, just via UI.

But seeing the list might give an idea what type of tracking is actually needed (surely nobody needs the implementation a whole UI based programming language — which is what Tag Managers seem to be).

Time

  • Time since pageload

Page Variables

  • Custom JS (eureka!)
  • DOM Element - gets value from dom element
  • Data Layer - afaiu a fancy handle on localStorage
  • First Party Coockie - reads from a cookie
  • Referrer URL
  • URL Parameter - a specific param
  • URL Variable - current page url

SEO

  • Page Meta Content - reads from meta tags

Utilities

  • Constants

Others

  • Custom Request processing function
  • Matomo config (what you see above: configures the matomo analytics tracker)

I think all of these can be simply subsumed by injecting a custom tracking function into frappe.fel:

frappe.fel = (event_name) => ...;
// could become
frappe.fel = {% my_injected_tracker_function %} => (event_name, data) => ... /* continue with the default */;

In the Facebook case, I would want to extract the Facebook Click ID from the query parameter and make sure it's pushed as data payload. That's it. The backend facebook integration would then have to extract that freeform data from all events when talking to facebook conversion api. Simple.


Edit

I prototyped this in frappe/frappe@42e0280

image


image

from builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.