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

Commit

Permalink
feat: 增加 aplus provider
Browse files Browse the repository at this point in the history
  • Loading branch information
xuebin committed Apr 2, 2020
1 parent d1dbc8a commit 85ced43
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
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')
2 changes: 2 additions & 0 deletions src/providers/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Fullstory = require './fullstory'
GrowingIO = require './growingio'
TBPanel = require './tbpanel'
Sensors = require './sensorsdata'
Aplus = require './aplus'

module.exports =
google: Google
Expand All @@ -14,3 +15,4 @@ module.exports =
fullstory: Fullstory
growingio: GrowingIO
sensors: Sensors
aplus: Aplus

0 comments on commit 85ced43

Please sign in to comment.