From b168319437f9c6a6df07fad61f395588ecd04541 Mon Sep 17 00:00:00 2001 From: xuebin Date: Thu, 2 Apr 2020 16:53:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20aplus=20provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/providers/aplus.coffee | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/providers/aplus.coffee diff --git a/src/providers/aplus.coffee b/src/providers/aplus.coffee new file mode 100644 index 0000000..f0345c7 --- /dev/null +++ b/src/providers/aplus.coffee @@ -0,0 +1,27 @@ +BaseProvider = require './base' +Common = require '../common' + +module.exports = +class Aplus extends BaseProvider + name: 'aplus' + + constructor: (@account) -> + script = document.createElement('script') + script.type = 'text/javascript' + script.id = 'beacon-aplus' + script.src = '//g.alicdn.com/alilog/mlog/aplus_v2.js' + script.setAttribute('exparams', 'clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx') + script.async = true + script.defer = true + + # 部署位置原则上在body标签之后, 越靠前越好, 最好是body内第一行 + body = document.getElementsByTagName('body')[0] + body.insertBefore(script, body.firstChild) + + event: (gtaOptions) -> + for property, value of gtaOptions + gokeys.push "#{property}=#{value}" + + gokey = gokeys.join('-') + + window.goldlog?.record(@account, 'CLK', gokey, 'GET')