Skip to content

Commit

Permalink
start game analitycs
Browse files Browse the repository at this point in the history
  • Loading branch information
Laubot committed Nov 7, 2023
1 parent 8fc9452 commit fcc6a97
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Binary file modified public/Build/public.data
Binary file not shown.
2 changes: 1 addition & 1 deletion public/Build/public.framework.js

Large diffs are not rendered by default.

Binary file modified public/Build/public.wasm
Binary file not shown.
25 changes: 13 additions & 12 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,19 @@
function showUI() {
document.getElementById("uiexterno").style.display = "block";
}


function registrar(eventName, eventParams) {
//analytics.logEvent(eventName);
//console.log('logEvent', eventName);
let ep = JSON.parse(eventParams.replace(/([0-9]{1,})(,)([0-9]{1,})/g,"$1.$3"));
for(let key in ep) {
ep[key] = isNaN(Number(ep[key]))? ep[key]: Number(ep[key]);
}
ep.upid = getUid();
console.log("registrar", eventName, eventParams, ep);
window.analytics.logEvent(eventName, ep);//JSON.parse(eventParams) {coin: 1, speed: 2, time: 3}
}

async function storeScore(name, score) {
try {
const now = new Date();
Expand Down Expand Up @@ -132,17 +144,6 @@
return [...new Map(a.map(x => [key(x), x])).values()]
}

function registrar(eventName, eventParams) {
//analytics.logEvent(eventName);
//console.log('logEvent', eventName);
let ep = JSON.parse(eventParams.replace(/([0-9]{1,})(,)([0-9]{1,})/g,"$1.$3"));
for(let key in ep) {
ep[key] = isNaN(Number(ep[key]))? ep[key]: Number(ep[key]);
}
ep.upid = getUid();
console.log("registrar", eventName, eventParams, ep);
window.analytics.logEvent(eventName, ep);//JSON.parse(eventParams) {coin: 1, speed: 2, time: 3}
}
</script>

<script>
Expand Down

0 comments on commit fcc6a97

Please sign in to comment.