Browse Source

feat: 202207活动新增埋点c_svip_day

cuiyalong 3 years ago
parent
commit
744299873e

+ 2 - 2
src/jfw/modules/app/src/web/templates/frontRouter/activity/sess/task-202207.html

@@ -247,8 +247,8 @@
                 </div>
                 <!-- 右侧悬浮 -->
                 <div class="fixed-right">
-                    <div class="fixed-action-button" @click="dialogShow('rule', true)"><div>活动</div><div>规则</div></div>
-                    <div class="fixed-action-button" @click="dialog.myReward = true"><div>我的</div><div>奖励</div></div>
+                    <div class="fixed-action-button" @click="clickRules"><div>活动</div><div>规则</div></div>
+                    <div class="fixed-action-button" @click="clickMyReward"><div>我的</div><div>奖励</div></div>
                 </div>
             </div>
             <!-- 我的奖励 -->

+ 55 - 9
src/web/staticres/common-module/active/2022.7/task-202207.js

@@ -129,6 +129,20 @@ function activeOverCheck (endTime, callback) {
   }
 }
 
+var platform = utils.isWeiXinBrowser ? 'wx' : 'app'
+function trackClick (c_type) {
+  if (!c_type) return
+  try {
+    clab_tracker.track('c_svip_day', {
+      c_platform: platform,
+      c_type: c_type,
+      date: new Date()
+    })
+  } catch (error) {
+    console.log(error)
+  }
+}
+
 var shareMixin = {
   data: function () {
     return {
@@ -489,6 +503,7 @@ var task = new Vue({
       var _this = this
       $('.j-header.jy-app-header .header-right').on('click', function () {
         _this.shareShow = true
+        trackClick('点击分享-actionSheet-显示')
       })
     },
     add0: function (t) {
@@ -711,12 +726,15 @@ var task = new Vue({
     },
     receiveYuReCoupon: function () {
       if (this.yureInfo.buttonDisabled) {
+        trackClick('点击预热-敬请期待')
         this.$toast('活动尚未开始,敬请期待')
       } else if (this.yureInfo.buttonText === '去查看') {
         // 领过了,跳转订单列表
+        trackClick('点击预热-去查看')
         this.toOrderPage()
       } else {
         // 没领过
+        trackClick('点击预热-领取7天超级订阅')
         this.receiveYuReCouponAjax()
       }
     },
@@ -763,15 +781,23 @@ var task = new Vue({
     },
     receiveActiveCoupon: function (coupons) {
       if (this.activeState !== 'activating') {
+        trackClick('点击福利一-敬请期待')
         return this.activeNotStartToast()
       }
       if (coupons.length === 0) return
       if (coupons.length === 1) {
         var item = coupons[0]
+        var reduce = item.Reduce
         if (!item.IsReceive && item.IsUser) {
+          trackClick('点击福利一-' + reduce + '元优惠券-去使用')
           return this.toBuyVip(item.query)
+        } else {
+          trackClick('点击福利一-' + reduce + '元优惠券-领取')
         }
       }
+      if (coupons.length > 1) {
+        trackClick('点击福利一-一键领取')
+      }
       var idArr = []
       coupons.forEach(function (item) {
         if (item.IsReceive) {
@@ -893,6 +919,8 @@ var task = new Vue({
       })
     },
     onClickListItem: function (item) {
+      var trackText = item.rewardText + '(FROM:' + item.receiveFrom + ')'
+      trackClick('点击我的奖励奖品-'+ trackText)
       if (item.icon === 'jy-svip') {
         this.toOrderPage()
       } else if (item.icon === 'jy-coin') {
@@ -910,6 +938,7 @@ var task = new Vue({
     onClickReceive: function (type, item) {
       if (this.activeState !== 'activating') {
         // this.$toast('活动尚未开始,敬请期待')
+        trackClick('点击福利二-'+ (item.name || item.id) +'-敬请期待')
         return this.activeNotStartToast()
       }
       if (item.className === 'received') return
@@ -917,6 +946,7 @@ var task = new Vue({
       if (type === 'schedule') {
         if (item.className === 'wait') {
           status = true
+          trackClick('点击福利二-'+ item.id +'-免费领')
         } else {
           var text = '尚未达到领取条件,无法领取'
           switch (item.id) {
@@ -938,6 +968,7 @@ var task = new Vue({
       }
       if (!status) {
         var _this = this
+        trackClick('点击福利二-'+ item.name +'-去完成')
         switch (item.id) {
           case 'buyvip': {
             this.toBuyVip()
@@ -964,6 +995,7 @@ var task = new Vue({
       }
       var _this = this
       if (type === 'mission') {
+        trackClick('点击福利二-'+ item.name +'-去领取')
         this.leaveCanvas(item)
       }
       this.ajaxReceive({ type: type, value: item.id }, function (result, msg) {
@@ -1119,15 +1151,16 @@ var task = new Vue({
       })
     },
     receiveFuli3: function () {
-      if (this.activeState === 'activating') {
-        if (this.power.memberStatus > 0) {
-          if (utils.isWeiXinBrowser) {
-            location.href = '/big/wx/page/landingPage'
-          } else {
-            location.href = '/jyapp/big/page/main_root'
-          }
-          return
+      if (this.power.memberStatus > 0) {
+        trackClick('点击福利三-立即体验-跳转大会员首页')
+        if (utils.isWeiXinBrowser) {
+          location.href = '/big/wx/page/landingPage'
+        } else {
+          location.href = '/jyapp/big/page/main_root'
         }
+        return
+      } else {
+        trackClick('点击福利三-立即体验-留资')
       }
 
       if (utils.isWeiXinBrowser) {
@@ -1136,8 +1169,13 @@ var task = new Vue({
         location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=super_membership_day'
       }
     },
-    doShareAjax: function () {
+    doShareAjax: function (shareItem) {
       var missionComplete = this.missionsList[2].complete
+      if (utils.isWeiXinBrowser) {
+        trackClick('点击分享-分享到微信/朋友圈')
+      } else {
+        trackClick('点击分享-分享到' + shareItem.name)
+      }
       if (this.activeState === 'activating' && !missionComplete) {
         var _this = this
         $.ajax({
@@ -1217,6 +1255,14 @@ var task = new Vue({
         }
       })
     },
+    clickRules: function () {
+      trackClick('点击活动规则')
+      this.dialogShow('rule', true)
+    },
+    clickMyReward: function () {
+      trackClick('点击我的奖励')
+      this.dialog.myReward = true
+    },
     toOrderPage: function () {
       if (utils.isWeiXinBrowser) {
         location.href = '/weixin/pay/toMyWxOrder?active=0'

+ 1 - 1
src/web/staticres/common-module/public/js/app-share-sheet.js

@@ -73,7 +73,7 @@ var appShareSheet = {
       this.$emit('input', f)
     },
     onSelect: function (item) {
-      this.$emit('share')
+      this.$emit('share', item)
       this.doAppShare(item)
     },
     doAppShare: function (item) {

+ 49 - 6
src/web/staticres/frontRouter/pc/activity/js/task-202207.js

@@ -159,6 +159,19 @@ function showDialogOfType (type) {
   }
 }
 
+function trackClick (c_type) {
+  if (!c_type) return
+  try {
+    clab_tracker.track('c_svip_day', {
+      c_platform: 'pc',
+      c_type: c_type,
+      date: new Date()
+    })
+  } catch (error) {
+    console.log(error)
+  }
+}
+
 // 固定事件
 $(function () {
   // 弹窗按钮事件
@@ -619,11 +632,14 @@ var task = new Vue({
     receiveYuReCoupon: function () {
       if (this.yureInfo.buttonDisabled) {
         toastFn('活动尚未开始,敬请期待')
+        trackClick('点击预热-敬请期待')
       } else if (this.yureInfo.buttonText === '去查看') {
         // 领过了
+        trackClick('点击预热-去查看')
         this.toOrderPage()
       } else {
         // 没领过
+        trackClick('点击预热-领取7天超级订阅')
         this.receiveYuReCouponAjax()
       }
     },
@@ -666,15 +682,23 @@ var task = new Vue({
     },
     receiveActiveCoupon: function (coupons) {
       if (this.activeState !== 'activating') {
+        trackClick('点击福利一-敬请期待')
         return this.activeNotStartToast()
       }
       if (coupons.length === 0) return
       if (coupons.length === 1) {
         var item = coupons[0]
+        var reduce = item.Reduce
         if (!item.IsReceive && item.IsUser) {
+          trackClick('点击福利一-' + reduce + '元优惠券-去使用')
           return this.toBuyVip(item.query)
+        } else {
+          trackClick('点击福利一-' + reduce + '元优惠券-领取')
         }
       }
+      if (coupons.length > 1) {
+        trackClick('点击福利一-一键领取')
+      }
       var idArr = []
       coupons.forEach(function (item) {
         if (item.IsReceive) {
@@ -798,6 +822,8 @@ var task = new Vue({
       })
     },
     onClickListItem: function (item) {
+      var trackText = item.rewardText + '(FROM:' + item.receiveFrom + ')'
+      trackClick('点击我的奖励奖品-'+ trackText)
       if (item.icon === 'jy-svip') {
         this.toOrderPage()
       } else if (item.icon === 'jy-coin') {
@@ -809,12 +835,16 @@ var task = new Vue({
       }
     },
     onClickReceive: function (type, item) {
-      if (this.activeState !== 'activating') return toastFn('活动尚未开始,敬请期待')
+      if (this.activeState !== 'activating') {
+        trackClick('点击福利二-'+ (item.name || item.id) +'-敬请期待')
+        return toastFn('活动尚未开始,敬请期待')
+      }
       if (item.className === 'received') return
       var status = false
       if (type === 'schedule') {
         if (item.className === 'wait') {
           status = true
+          trackClick('点击福利二-'+ item.id +'-免费领')
         } else {
           var text = '尚未达到领取条件,无法领取'
           switch (item.id) {
@@ -836,6 +866,7 @@ var task = new Vue({
       }
       if (!status) {
         var _this = this
+        trackClick('点击福利二-'+ item.name +'-去完成')
         switch (item.id) {
           case 'buyvip': {
             this.toBuyVip()
@@ -855,6 +886,7 @@ var task = new Vue({
       }
       var _this = this
       if (type === 'mission') {
+        trackClick('点击福利二-'+ item.name +'-去领取')
         this.leaveCanvas(item)
       }
       this.ajaxReceive({ type: type, value: item.id }, function (result, msg) {
@@ -992,11 +1024,12 @@ var task = new Vue({
       })
     },
     receiveFuli3: function () {
-      if (this.activeState === 'activating') {
-        if (window.memberStatus > 0) {
-          window.open('/swordfish/page_big_pc/')
-          return
-        }
+      if (window.memberStatus > 0) {
+        trackClick('点击福利三-立即体验-跳转大会员首页')
+        window.open('/swordfish/page_big_pc/')
+        return
+      } else {
+        trackClick('点击福利三-立即体验-留资')
       }
       vm.isNeedSubmit('super_membership_day',function(){
         vm.showSuccess = true
@@ -1016,6 +1049,7 @@ var task = new Vue({
           }
         })
       }
+      trackClick('点击复制链接')
       this.copyText('快来和我一起参与吧!剑鱼超级会员节,百万补贴限量抢,快速获取商机信息》\n' + this.copyLinkText)
       toastFn('复制成功')
     },
@@ -1056,10 +1090,19 @@ var task = new Vue({
         showHide()
       })
     },
+    clickRules: function () {
+      trackClick('点击活动规则')
+      this.scrollTo('.activity-rules')
+    },
+    clickMyReward: function () {
+      trackClick('点击我的奖励')
+      this.dialog.myReward = true
+    },
     toOrderPage: function () {
       window.open('/front/swordfish/toMyOrder')
     },
     toMemberPage: function () {
+      trackClick('点击福利三-了解更多')
       window.open('/big/page/index')
     },
     toBuyVip: function (query) {

+ 2 - 2
src/web/templates/frontRouter/pc/activity/sess/task-202207.html

@@ -271,8 +271,8 @@
         </div>
         <!-- 右侧悬浮 -->
         <div class="fixed-right">
-            <button class="fixed-action-button" @click="scrollTo('.activity-rules')">活动<br />规则</button>
-            <button class="fixed-action-button" @click="dialog.myReward = true">我的<br />奖励</button>
+            <button class="fixed-action-button" @click="clickRules">活动<br />规则</button>
+            <button class="fixed-action-button" @click="clickMyReward">我的<br />奖励</button>
         </div>
         <!-- 奖励 table -->
         <el-dialog title="我的奖励" class="no-select reward-section" :lock-scroll="false" append-to-body :visible.sync="dialog.myReward">

+ 2 - 2
src/web/templates/frontRouter/wx/activity/sess/task-202207.html

@@ -235,8 +235,8 @@
                 </div>
                 <!-- 右侧悬浮 -->
                 <div class="fixed-right">
-                    <div class="fixed-action-button" @click="dialogShow('rule', true)"><div>活动</div><div>规则</div></div>
-                    <div class="fixed-action-button" @click="dialog.myReward = true"><div>我的</div><div>奖励</div></div>
+                    <div class="fixed-action-button" @click="clickRules"><div>活动</div><div>规则</div></div>
+                    <div class="fixed-action-button" @click="clickMyReward"><div>我的</div><div>奖励</div></div>
                 </div>
             </div>
             <!-- 我的奖励 -->