google、观测云埋点

This commit is contained in:
yuyongdong 2024-04-22 19:19:57 +08:00
parent 80fb1e1a20
commit c34d8d6da9
12 changed files with 108 additions and 10 deletions

View File

@ -17,6 +17,8 @@ VUE_APP_CHAIN_ID = '5611'
VUE_APP_APP_NAME = 'CF UAW'
VUE_APP_MODE = 'development'
# 铭文的验证地址
VUE_APP_SCRIPTION_ADDRESS='0xcd4bb3402f1a444a1af10f31946ed37dac0eac4d'
# VUE_APP_SCRIPTION_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39'

View File

@ -15,5 +15,7 @@ VUE_APP_CHAIN_ID = '204'
VUE_APP_APP_NAME = 'CF UAW'
VUE_APP_MODE = 'production'
VUE_APP_SCRIPTION_ADDRESS='0xcd4bb3402f1a444a1af10f31946ed37dac0eac4d'
VUE_APP_CONTRACT='0x03B6f01EB419915B1F157e67C8263101ddd6E15e'

23
package-lock.json generated
View File

@ -8,6 +8,7 @@
"name": "uawgame",
"version": "0.1.0",
"dependencies": {
"@cloudcare/browser-rum": "^3.1.11",
"@walletconnect/ethereum-provider": "^2.11.2",
"@walletconnect/modal": "^2.6.2",
"axios": "^1.6.8",
@ -1851,6 +1852,28 @@
"node": ">=6.9.0"
}
},
"node_modules/@cloudcare/browser-core": {
"version": "3.1.11",
"resolved": "https://registry.npmmirror.com/@cloudcare/browser-core/-/browser-core-3.1.11.tgz",
"integrity": "sha512-GX5UIyvznSIO11N2DCaHL7NcniogMYAo7f7AQKDIgGKpFM9s6QspwY43XituUC8veSBvlSiPdE72MTCJF9ACxA=="
},
"node_modules/@cloudcare/browser-rum": {
"version": "3.1.11",
"resolved": "https://registry.npmmirror.com/@cloudcare/browser-rum/-/browser-rum-3.1.11.tgz",
"integrity": "sha512-zVNV0TxpIhiC18ge3Gjqiuep5Z3VB8uJdFDtSSoKac/2nFUnILQGE7MMunIbA4yATOy2UzDqDIbcHH3a2DK1Kw==",
"dependencies": {
"@cloudcare/browser-core": "3.1.11",
"@cloudcare/browser-worker": "3.1.11"
}
},
"node_modules/@cloudcare/browser-worker": {
"version": "3.1.11",
"resolved": "https://registry.npmmirror.com/@cloudcare/browser-worker/-/browser-worker-3.1.11.tgz",
"integrity": "sha512-Rs1Nvb/38DmSX12TRHTgr6GjeUEWwkNrJLFPSohiOjEZVhq5gVVk/r3vutRs3hCaKW1Fh++ouMECzh1vp2rywA==",
"dependencies": {
"@cloudcare/browser-core": "3.1.11"
}
},
"node_modules/@discoveryjs/json-ext": {
"version": "0.5.7",
"resolved": "https://registry.npmmirror.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz",

View File

@ -10,6 +10,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@cloudcare/browser-rum": "^3.1.11",
"@walletconnect/ethereum-provider": "^2.11.2",
"@walletconnect/modal": "^2.6.2",
"axios": "^1.6.8",
@ -22,10 +23,10 @@
"postcss-px-to-viewport": "^1.1.1",
"swiper": "^5.4.5",
"vue": "^2.6.14",
"vue-gtag": "^1.16.1",
"vue-loader": "^15.10.1",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
"vue-gtag": "^1.16.1",
"web3": "^4.5.0"
},
"devDependencies": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -8,6 +8,7 @@
<script>
import { apiCheckActivity } from "@/utils/webapi.js";
import { datafluxRum } from '@cloudcare/browser-rum'
export default {
props: {
title: String,
@ -27,6 +28,9 @@ export default {
let { errcode, errmsg, data } = await apiCheckActivity(
this.itemData.id
);
datafluxRum.addRumGlobalContext('task_type',{
name: itemData.task+'Verify'
})
if (errcode !== 0) {
if (errmsg == "twitter already binded") {
this.$showErr("twitter already binded");

View File

@ -61,10 +61,10 @@ let errmsg = err
} else if(errmsg.indexOf("Delabs Game") > -1) {
errmsg = "You do not hold the required role in the 'Delabs Game' Discord server"
} else if(errmsg.indexOf('Please try again') > -1) {
errmsg = "Verification failed due to high traffic. Please click 'Connect' to try verifying again, or attempt later"
errmsg = "Verification failed due to high traffic. Please attempt to verify again or try later"
} else {
// 请重试
errmsg = 'Unknown on-chain interaction issue. Please try again'
errmsg = 'An unknown on-chain interaction error has occurred. Our technical team cannot resolve this issue directly. Please use a blockchain explorer to check your wallet address and determine if the transaction was recorded or if another issue exists.'
}
const _confirm = new iErrorMessage({

View File

@ -89,9 +89,8 @@ export default {
let require = {activity: this.activity, val}
await this.$store.dispatch('user/login', require)
await this.$store.dispatch('user/fetchUserState')
this.$gtag.event("login_info", {
address_type: this.myAddress,
})
this.eventGtag()
localStorage.setItem('myToken',localStorage.getItem('token') )
location.reload()
},
@ -141,6 +140,13 @@ export default {
localStorage.removeItem('walletName')
// location.reload()
},
// Google gtag
eventGtag() {
this.$gtag.event("login_info", {
address_type: this.myAddress,
})
},
}
};
</script>

View File

@ -38,6 +38,22 @@ Vue.use(VueGtag, {
// duration: 3 * 1000
// })
// }
//引入观测云rum的sdk
import { datafluxRum } from '@cloudcare/browser-rum'
datafluxRum.init({
applicationId: '20efe220_006a_11ef_941d_2d8bd5427e6e',
site: 'https://ap1-rum-openway.guance.one',
clientToken: '2OQwyC5Quls2McUi6QIUF7mzxD3ryhHDFwIMQHBBfUoiNCR_OQ',
env: process.env.VUE_APP_MODE,
version: '1.0.0',
service: 'browser',
sessionSampleRate: 100,
sessionReplaySampleRate: 70,
trackInteractions: true,
traceType: 'ddtrace', // 非必填默认为ddtrace目前支持 ddtrace、zipkin、skywalking_v3、jaeger、zipkin_single_header、w3c_traceparent 6种类型
allowedTracingOrigins: ['https://api.example.com',/https:\/\/.*\.my-api-domain\.com/], // 非必填允许注入trace采集器所需header头部的所有请求列表。可以是请求的origin也可以是是正则
});
datafluxRum.startSessionReplayRecording()
Vue.config.productionTip = false

View File

@ -79,7 +79,7 @@
<span v-if="boxData.level == 1">COMMON</span>
<span v-else-if="boxData.level == 2">RARE</span>
<span v-else-if="boxData.level == 3">MYTHICAL</span>
<span v-else-if="boxData.level == 4">LEGENDAY</span>
<span v-else-if="boxData.level == 4">LEGENDARY</span>
</div>
</div>
<div class="box-btm-con-img">
@ -273,7 +273,7 @@ export default {
myRecordsList: [],
boostingPageSize: 6,
boostingCurrentPage: 1,
isLoading: false
isLoading: false,
}
},
computed: {
@ -311,7 +311,6 @@ export default {
//
filteredBoxBar() {
console.log('this.boxData.bounsCount',this.boxData.bounsCount,this.boxData.maxBounsCount)
if(this.boxData.bounsCount) {
return Number(this.boxData.bounsCount) / Number(this.boxData.maxBounsCount) * 100
} else {
@ -468,6 +467,10 @@ export default {
oInput.className = "oInput";
oInput.style.display = "none";
this.$message.success("Copy succeeded");
let address_type = localStorage.getItem("myAddress")
this.$gtag.event("invite_new",{
address_type: address_type,
})
},
//

View File

@ -643,6 +643,7 @@ import Loading from "@/components/loading.vue";
import RuleDialog from "./ruleDialog.vue";
import NftPartner from './nftPartner.vue'
import { getToken } from "@/utils/cookies.js";
import { datafluxRum } from '@cloudcare/browser-rum'
// import { getWalletAddress, isWalletConnected, linkWallet } from "@/wallet/index.js";
import {
apiUploadInviteCode,
@ -836,6 +837,7 @@ export default {
this.helpConfirm()
}
}
this.countTime()
} else {
this.walletDialogVisible = true;
}
@ -894,7 +896,7 @@ export default {
await this.getProgress();
}
}
this.rumGtag(data.task)
if (data.task == "TwitterConnect") {
await this.loginTwitter(data.id);
} else if(data.task == "TwitterFollow") {
@ -1270,6 +1272,10 @@ export default {
oInput.className = "oInput";
oInput.style.display = "none";
this.$message.success("Copy succeeded");
let address_type = localStorage.getItem("myAddress")
this.$gtag.event("invite_new",{
address_type: address_type,
})
} else {
this.walletDialogVisible = true;
}
@ -1359,6 +1365,41 @@ export default {
openLink() {
window.open('https://medium.com/@CounterFire/hills-treasure-hunt-3d076f637838')
},
//
countTime: function() {
var now = new Date().getTime()
let refreshTime = new Date(new Date().toLocaleDateString()).getTime()+86400000
// +86400000; .getTime()
let leftTime = refreshTime - now
if(leftTime <= 0) {
this.eventGtag()
}
setTimeout(this.countTime, 1000);
},
//
clearEndTime(startTime) {
if(startTime == 0){
let interval_id = setInterval(()=> {
clearInterval(interval_id)
// window.location.reload()
},2000)
}
},
// Google gtag
eventGtag() {
let address_type = localStorage.getItem('myAdderss')
this.$gtag.event("login_info", {
address_type: address_type,
})
},
//
rumGtag(name) {
datafluxRum.addRumGlobalContext('task_type', {
name: name,
});
},
}
};
</script>