MCPcopy Create free account
hub / github.com/DavidWells/analytics / send

Method send

packages/analytics-plugin-ownstats/src/node.js:8–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 this.reqUrl = `https://${endpoint}/hello.gif`
7 }
8 send () {
9 const qs = []
10 // Build querystring
11 for (var property in data) {
12 if (data.hasOwnProperty(property)) {
13 qs.push(`${property}=${encodeURIComponent(data[property].toString())}`)
14 }
15 }
16 const url = `${this.reqUrl}?${qs.join('&')}`
17 // Send data
18 https.get(url, (response) => {
19 let responseData = ''
20 response.on('data', (chunk) => {
21 responseData += chunk
22 })
23 response.on('end', () => {
24 return true
25 })
26 }).on("error", (err) => {
27 throw new Error(err.message)
28 })
29 }
30}
31
32/**

Callers 4

ownstatsPluginFunction · 0.95
pageViewFunction · 0.80
trackEventFunction · 0.80
callAwsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected