Hello @heurteph-ei,
The Matomo version is 4.3.1 . Could you please guide me on how to find the MTM version?
This is my code:
function mtm_event(args){
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var _mtmData = {'event': 'UniSIS.'+args.action, 'mtm.category':args.category, 'mtm.action': args.action, 'mtm.name':args.name};
_mtm.push(_mtmData);
console.log(_mtm);
}
mtm_event({'category': 'Documents','action':'FDU', 'name':'First document uploaded'});
mtm_event({'category': 'Documents','action':'ARDU', 'name':'All required documents uploaded'});
Below you can see the console.log of the second mtm_event call:
Array(5)
0: {uid: "the id that I send"}
1: {mtm.category: "Documents", mtm.action: "FDU", mtm.name: "First document uploaded", event: "UniSIS.FDU"}
2: {mtm.category: "Documents", mtm.action: "ARDU", mtm.name: "All required documents uploaded", event: "consequentlyEvent.ARDU"}
3: {mtm.startTime: 1622721971147, event: "mtm.Start"}
4: {siteId: "14"}
push: ƒ ()
length: 5
__proto__: Array(0)
As you can see, I get the two events details correctly.
1: {mtm.category: "Documents", mtm.action: "FDU", mtm.name: "First document uploaded", event: "UniSIS.FDU"}
2: {mtm.category: "Documents", mtm.action: "ARDU", mtm.name: "All required documents uploaded", event: "consequentlyEvent.ARDU"}
The two events retain their own details.
On the matomo debugger I get the following:
For the First document uploaded event:
Pushed data by this event
{ "event": "mtm.CustomEvent", "mtm.customEventMatch": "UniSIS.FDU" }
Content after this event
{ "mtm.containerId": "my container Id", "uid": "the id that I send", "mtm.category": "Documents", "mtm.action": "ARDU", "mtm.name": "All required documents uploaded", "event": "mtm.CustomEvent", "mtm.startTime": 1622721971147, "siteId": "14", "mtm.mtmScriptLoadedTime": 1622721971759, "unicaf_uuid": "the id that I send", "gtm.start": 1622721971146, "gtm.uniqueEventId": 11, "userInteraction": { "category": "sisStudentSideEvent", "label": "campaignAdID", "non-interaction-hit": false }, "importantMarketingVariables": { "utm_source": "SC_nA", "utm_medium": "MC_nA", "utm_term": "TC_nA", "utm_content": "CoC_nA", "utm_campaign": "CC_nA", "gcl_id": "GC_nA", "devicemodel": null, "adID": null, "placement": null, "loc_physical_ms": null, "target": null }, "gtm.scrollThreshold": 0, "gtm.scrollUnits": "percent", "gtm.scrollDirection": "vertical", "gtm.triggers": "13528378_54", "mtm.customEventMatch": "UniSIS.FDU" }
For the All required documents uploaded event:
Pushed data by this event
{ "event": "mtm.CustomEvent", "mtm.customEventMatch": "consequentlyEvent.ARDU" }
Content after this event
{ "mtm.containerId": "my container Id", "uid": "the id that I send", "mtm.category": "Documents", "mtm.action": "ARDU", "mtm.name": "All required documents uploaded", "event": "mtm.CustomEvent", "mtm.startTime": 1622721971147, "siteId": "14", "mtm.mtmScriptLoadedTime": 1622721971759, "unicaf_uuid": "the id that I send", "gtm.start": 1622721971146, "gtm.uniqueEventId": 11, "userInteraction": { "category": "sisStudentSideEvent", "label": "campaignAdID", "non-interaction-hit": false }, "importantMarketingVariables": { "utm_source": "SC_nA", "utm_medium": "MC_nA", "utm_term": "TC_nA", "utm_content": "CoC_nA", "utm_campaign": "CC_nA", "gcl_id": "GC_nA", "devicemodel": null, "adID": null, "placement": null, "loc_physical_ms": null, "target": null }, "gtm.scrollThreshold": 0, "gtm.scrollUnits": "percent", "gtm.scrollDirection": "vertical", "gtm.triggers": "13528378_54", "mtm.customEventMatch": "consequentlyEvent.ARDU" }
As you can see, on the First document uploaded event the “mtm.action” and “mtm.name” values are replaced by the “All required documents uploaded” event details.
Also, for some reason the object contais gtm values that I don’t push on the data layer.