Commit c9ffd775 authored by 张九刚's avatar 张九刚

feat: 首页埋点

parent 7352416d
No preview for this file type
{
"editor.semanticHighlighting.enabled": false,
"files.associations": {
"*.wxml": "html",
"*.wxss": "css",
"*.wxs": "javascript"
},
"editor.tokenColorCustomizations": {
"comments": "#9AA0A6",
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"punctuation.definition.comment"
],
"settings": { "foreground": "#9AA0A6" }
},
{
"scope": [
"comment.block.html",
"punctuation.definition.comment.html",
"comment.block.vue",
"punctuation.definition.comment.vue",
"comment.block.vue-html",
"punctuation.definition.comment.vue-html",
"comment.block.xml",
"punctuation.definition.comment.xml"
],
"settings": { "foreground": "#9AA0A6" }
},
{
"scope": [
"comment.block.js",
"comment.line.double-slash.js",
"punctuation.definition.comment.js",
"comment.block.javascript",
"comment.line.double-slash.javascript",
"punctuation.definition.comment.javascript"
],
"settings": { "foreground": "#9AA0A6" }
},
{
"scope": [
"comment.block.css",
"punctuation.definition.comment.css"
],
"settings": { "foreground": "#9AA0A6" }
}
],
"[Default Dark+]": {
"comments": "#9AA0A6",
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"punctuation.definition.comment",
"comment.block.html",
"punctuation.definition.comment.html",
"comment.block.vue",
"punctuation.definition.comment.vue",
"comment.block.vue-html",
"punctuation.definition.comment.vue-html",
"comment.block.xml",
"punctuation.definition.comment.xml",
"comment.block.js",
"comment.line.double-slash.js",
"punctuation.definition.comment.js",
"comment.block.javascript",
"comment.line.double-slash.javascript",
"punctuation.definition.comment.javascript",
"comment.block.css",
"punctuation.definition.comment.css"
],
"settings": { "foreground": "#9AA0A6" }
}
]
},
"[Default Light+]": {
"comments": "#80868B",
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"punctuation.definition.comment",
"comment.block.html",
"punctuation.definition.comment.html",
"comment.block.vue",
"punctuation.definition.comment.vue",
"comment.block.vue-html",
"punctuation.definition.comment.vue-html",
"comment.block.xml",
"punctuation.definition.comment.xml",
"comment.block.js",
"comment.line.double-slash.js",
"punctuation.definition.comment.js",
"comment.block.javascript",
"comment.line.double-slash.javascript",
"punctuation.definition.comment.javascript",
"comment.block.css",
"punctuation.definition.comment.css"
],
"settings": { "foreground": "#80868B" }
}
]
},
"[Cursor Dark]": {
"comments": "#9AA0A6",
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"punctuation.definition.comment",
"comment.block.html",
"punctuation.definition.comment.html",
"comment.block.vue",
"punctuation.definition.comment.vue",
"comment.block.vue-html",
"punctuation.definition.comment.vue-html",
"comment.block.xml",
"punctuation.definition.comment.xml",
"comment.block.js",
"comment.line.double-slash.js",
"punctuation.definition.comment.js",
"comment.block.javascript",
"comment.line.double-slash.javascript",
"punctuation.definition.comment.javascript",
"comment.block.css",
"punctuation.definition.comment.css"
],
"settings": { "foreground": "#9AA0A6" }
}
]
},
"[Cursor Light]": {
"comments": "#80868B",
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"punctuation.definition.comment",
"comment.block.html",
"punctuation.definition.comment.html",
"comment.block.vue",
"punctuation.definition.comment.vue",
"comment.block.vue-html",
"punctuation.definition.comment.vue-html",
"comment.block.xml",
"punctuation.definition.comment.xml",
"comment.block.js",
"comment.line.double-slash.js",
"punctuation.definition.comment.js",
"comment.block.javascript",
"comment.line.double-slash.javascript",
"punctuation.definition.comment.javascript",
"comment.block.css",
"punctuation.definition.comment.css"
],
"settings": { "foreground": "#80868B" }
}
]
}
},
"editor.semanticTokenColorCustomizations": {
"enabled": false
}
}
......@@ -16,8 +16,8 @@ const {
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
// let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
......
......@@ -62,13 +62,13 @@ const sensorLog = (evt) => {
trackObj[key] = logObj[key];
}
if (xcxPage && xcxPage.length > 0) {
console.warn("xcxPage", trackObj);
// console.warn("xcxPage", trackObj);
sensors.track("xcxPage", {
...trackObj,
});
}
if (xcxClick && xcxClick.length > 0) {
console.warn("xcxClick", trackObj);
// console.warn("xcxClick", trackObj);
sensors.track("xcxClick", {
...trackObj,
});
......@@ -91,10 +91,56 @@ const sensorLogTake = (logObj) => {
};
sensorLog(evt);
};
const sensorComponentLog = (evt) => {
const _dataset = evt.currentTarget.dataset;
const logObj = _dataset.comlog;
if (!logObj) {
return;
}
const { xcxComponentExposure, xcxComponentClick } = logObj;
let trackObj = {};
for (let key in logObj) {
trackObj[key] = logObj[key];
}
if (xcxComponentExposure && xcxComponentExposure.length > 0) {
console.warn("-----xcxComponentExposure-----", trackObj);
sensors.track("xcxComponentExposure", {
...trackObj,
});
}
if (xcxComponentClick && xcxComponentClick.length > 0) {
console.warn("-----xcxComponentClick-----", trackObj);
sensors.track("xcxComponentClick", {
...trackObj,
});
}
};
/**
* 主动通过配置数据触发埋点
* @param {*} evt
*/
const sensorComponentLogTake = (logObj) => {
if (!logObj) {
return;
}
const evt = {
currentTarget: {
dataset: {
comlog: logObj,
},
},
};
sensorComponentLog(evt);
};
export default {
init,
sensors,
login,
sensorLog,
sensorLogTake,
sensorComponentLog,
sensorComponentLogTake,
};
......@@ -33,17 +33,6 @@
"jtIcon": "homepage/tool_jt.png",
"subtitle": "更多妈妈都在用,告别手忙脚乱,助你轻松带娃!",
"tools": [
{
"icon": "homepage/tool_icon_1.png",
"link": {
"extra": {},
"type": 1,
"url": "/pages/naming/naming"
},
"context": "AI生成吉利好名",
"type": 1,
"title": "AI起名"
},
{
"icon": "homepage/tool_icon_2.png",
"link": {
......@@ -114,13 +103,28 @@
"type": 1,
"url": "/pages/syWebview/syWebview?p=xmh09"
},
"title":"北纬47°鲜活溯源之旅",
"type": 1,
"url": "homepage/homeSwiper/V1/7.jpg"
},
{
"videoUrl": "homepage/homeSwiper/V1/2.m4v",
"link": {},
"title":"成为妈妈更懂妈妈",
"url": "homepage/homeSwiper/V1/2.png"
},
{
"img": "homepage/homeSwiper/V1/28会员日.jpg",
"title":"28会员日",
"link": {
"extra": {
"envVersion": "release",
"appId": "wx4205ec55b793245e"
},
"type": 2,
"url": "/subPackages/shopMainList/topicNew/index?id=1001087"
},
"url": "homepage/homeSwiper/V1/28会员日.jpg"
}
],
"childrenInfoList": [
......
......@@ -58,8 +58,13 @@ class ExposureTracker {
const isVisible = this.isElementInViewport(res, scrollTop);
if (isVisible && !value.isExposed) {
value.isExposed = true;
// 触发埋点
md.sensorLogTake(value.logParams);
if(value.logParams.xcxComponentExposure){
md.sensorComponentLogTake(value.logParams);
}else{
md.sensorLogTake(value.logParams);
}
}
});
});
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment