Hi givemeawhisky,
Thank you for getting back to me on this query.
I have followed your sample and have used the following code:
import wixWindow from 'wix-window';
$w.onReady(function () {
//TODO: write your page related code here...
});
export function button14_click(event) {
//Add your code for this event here:
wixWindow.trackEvent("CustomEvent", {
"event": "Test Button Clicked",
"eventCategory": "Test Button",
"eventAction": "click",
"eventLabel": "Test Button"
});
}
// open ( - 4
// close ) - 4
// open { - 3
// close } - 3
However we are still getting the same error in the masterPage.js file.
I have checked the ‘i805u.js’ file mentioned in the console which reads as follows:
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.i805u = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.button14_click = button14_click;
var _wixWindow = require("wix-window");
var _wixWindow2 = _interopRequireDefault(_wixWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
$w.onReady(function () {
//TODO: write your page related code here...
}); // For full API documentation, including code examples, visit https://wix.to/94BuAAs
function button14_click(event) {
//Add your code for this event here:
_wixWindow2.default.trackEvent("CustomEvent", {
"event": "Test Button Clicked",
"eventCategory": "Test Button",
"eventAction": "click",
"eventLabel": "Test Button"
});
}
},{"wix-window":undefined}]},{},[1])(1)
});
//# sourceMappingURL=https://c668a78b-032a-43fe-b0bb-2c542d6b9083.dev.wix-code.com/pages/i805u.js.map?empty-if-missing=true&exclude=wix-&module-name=i805u&viewMode=preview&instance=wixcode-dev.76b63554b583464fbe8ca1ca9582332093a2b948.eyJpbnN0YW5jZUlkIjoiYzY2OGE3OGItMDMyYS00M2ZlLWIwYmItMmM1NDJkNmI5MDgzIiwiY29ycmVsYXRpb25JZCI6IjI2ZThjOGUxLWE5NzktNGYzNS04NmNmLTI4NzQ5MmRiMmI1YiIsInNlc3Npb25VSWQiOiJkYmY5YmJhYS1kMmM1LTQ5MDctYjVlNy01NzA4YTBjZjk2YWMiLCJpc1RlbXBsYXRlIjpmYWxzZSwic2lnbkRhdGUiOjE1NzI5NDg0MDM2MDYsInNpdGVNZW1iZXJJZCI6ImRiZjliYmFhLWQyYzUtNDkwNy1iNWU3LTU3MDhhMGNmOTZhYyIsInVpZCI6ImRiZjliYmFhLWQyYzUtNDkwNy1iNWU3LTU3MDhhMGNmOTZhYyIsImFwcERlZklkIjoiQ2xvdWRTaXRlRXh0ZW5zaW9uIiwiaXNBZG1pbiI6ZmFsc2UsIm1ldGFTaXRlSWQiOiIyMzBhNTFiNC1hNDYwLTQxN2MtYjVjZS1lMmUzZDI0OTRjZDAiLCJjYWNoZSI6bnVsbCwiZXhwaXJhdGlvbkRhdGUiOiIyMDE5LTExLTA1VDE0OjA2OjQzLjYwNloiLCJzaXRlT3duZXJJZCI6IjM2MjQ2MmUyLTA1YjMtNGQzZS04MzBjLTQ1MjdlNTk2YjM0NCJ9&gridAppId=a9c19fb6-903b-44f4-a9ec-520840a6f9b1&cacheKiller=1572949734818
But I can’t see any obvious issues with this code.
Additionally, the same ‘masterPage.js’ error message is displayed on every page. Even pages where the ‘i805u.js’ and our tracking code is not loaded in.