mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-19 16:38:41 +00:00
广告优化,加入插件版本使用统计
This commit is contained in:
parent
7382afc602
commit
342d8b6f1c
@ -78,6 +78,7 @@ export enum GA_EventName {
|
|||||||
Hierarchy = "hierarchy",
|
Hierarchy = "hierarchy",
|
||||||
Inspector = "Inspector",
|
Inspector = "Inspector",
|
||||||
EngineVersion = "engine_version",
|
EngineVersion = "engine_version",
|
||||||
|
AppVersion = "app_version",
|
||||||
/**
|
/**
|
||||||
* 用户点击store广告链接
|
* 用户点击store广告链接
|
||||||
*/
|
*/
|
||||||
@ -86,6 +87,10 @@ export enum GA_EventName {
|
|||||||
* 用户主动关闭store广告
|
* 用户主动关闭store广告
|
||||||
*/
|
*/
|
||||||
CloseAd = "close_ad",
|
CloseAd = "close_ad",
|
||||||
|
/**
|
||||||
|
* 展示广告
|
||||||
|
*/
|
||||||
|
ShowAd = "show_ad",
|
||||||
}
|
}
|
||||||
export enum GA_Button {
|
export enum GA_Button {
|
||||||
Github = "github",
|
Github = "github",
|
||||||
|
@ -80,6 +80,9 @@ export default defineComponent({
|
|||||||
// 单位分钟
|
// 单位分钟
|
||||||
const diff = (Date.now() - time) / 1000 / 60;
|
const diff = (Date.now() - time) / 1000 / 60;
|
||||||
isShow.value = diff >= showDuration;
|
isShow.value = diff >= showDuration;
|
||||||
|
if (isShow.value && ads.value.length) {
|
||||||
|
ga(GA_EventName.ShowAd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="data" class="banner" :class="ani" @click="onClick" :title="data.tip" :style="getStyle()">
|
<div v-if="data" class="banner" :class="ani" @click="onClick" :title="data.tip" :style="getStyle()">
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span>
|
<span v-if="data.name">
|
||||||
{{ data.name }}
|
{{ data.name }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { debugLog, Msg, Page, PluginEvent } from "../../core/types";
|
import { debugLog, Msg, Page, PluginEvent } from "../../core/types";
|
||||||
import { DocumentEvent } from "../const";
|
import { GA_EventName } from "../../ga/type";
|
||||||
|
import { DocumentEvent, GoogleAnalyticsData } from "../const";
|
||||||
import { Terminal } from "../terminal";
|
import { Terminal } from "../terminal";
|
||||||
|
|
||||||
export class InjectEvent {
|
export class InjectEvent {
|
||||||
@ -23,4 +24,9 @@ export class InjectEvent {
|
|||||||
const event = new CustomEvent(DocumentEvent.EngineVersion, { detail });
|
const event = new CustomEvent(DocumentEvent.EngineVersion, { detail });
|
||||||
document.dispatchEvent(event);
|
document.dispatchEvent(event);
|
||||||
}
|
}
|
||||||
|
sendAppVersion(version: string) {
|
||||||
|
const detail = { event: GA_EventName.AppVersion, params: version } as GoogleAnalyticsData;
|
||||||
|
const event = new CustomEvent(DocumentEvent.GoogleAnalytics, { detail });
|
||||||
|
document.dispatchEvent(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user