Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

feat: 增加 aplus provider #20

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/providers/aplus.coffee
Original file line number Diff line number Diff line change
@@ -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')