Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
export { sayHello, sayGoodbye } from "./library"; | ||
export * from "./library"; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sayGoodbye = exports.sayHello = void 0; | ||
var library_1 = require("./library"); | ||
Object.defineProperty(exports, "sayHello", { enumerable: true, get: function () { return library_1.sayHello; } }); | ||
Object.defineProperty(exports, "sayGoodbye", { enumerable: true, get: function () { return library_1.sayGoodbye; } }); | ||
__exportStar(require("./library"), exports); |
@@ -1,2 +0,4 @@ | ||
export declare function sayHello(): void; | ||
export declare function sayGoodbye(): void; | ||
export declare function setClient(apiSecret: any, measurementId: any, clientId: any): void; | ||
export declare function readClient(): void; | ||
export declare function sendHit(events: any): void; | ||
export declare function testSendHit(events: any): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sayGoodbye = exports.sayHello = void 0; | ||
function sayHello() { | ||
console.log("Hi"); | ||
exports.testSendHit = exports.sendHit = exports.readClient = exports.setClient = void 0; | ||
const axios = require('axios'); | ||
var API_SECRET; | ||
var MEASUREMENT_ID; | ||
var CLIENT_ID; | ||
var GA_ENDPOINT; | ||
var TEST_ENDPOINT; | ||
function setClient(apiSecret, measurementId, clientId) { | ||
API_SECRET = apiSecret; | ||
MEASUREMENT_ID = measurementId; | ||
CLIENT_ID = clientId; | ||
GA_ENDPOINT = `https://www.google-analytics.com/mp/collect?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`; | ||
TEST_ENDPOINT = `https://www.google-analytics.com/debug/mp/collect?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`; | ||
} | ||
exports.sayHello = sayHello; | ||
function sayGoodbye() { | ||
console.log("Bye"); | ||
exports.setClient = setClient; | ||
function readClient() { | ||
console.log("API_SECRET: " + API_SECRET); | ||
console.log("MEASUREMENT_ID: " + MEASUREMENT_ID); | ||
console.log("CLIENT_ID: " + CLIENT_ID); | ||
console.log("GA_ENDPOINT: " + GA_ENDPOINT); | ||
console.log("TEST_ENDPOINT: " + TEST_ENDPOINT); | ||
} | ||
exports.sayGoodbye = sayGoodbye; | ||
exports.readClient = readClient; | ||
/* | ||
SendHit: events must match the array format: | ||
// [{ | ||
name: 'tutorial_begin', | ||
params: {}, | ||
},{ | ||
name: 'tutorial_complete', | ||
params: {}, | ||
}] | ||
Can send up to 25 events at once | ||
*/ | ||
function sendHit(events) { | ||
axios.post(GA_ENDPOINT, { | ||
client_id: CLIENT_ID, | ||
events: events | ||
}).then(res => { | ||
console.log(`statusCode: ${res.statusCode}`); | ||
console.log(res); | ||
}).catch(error => { | ||
console.log(error); | ||
}); | ||
} | ||
exports.sendHit = sendHit; | ||
function testSendHit(events) { | ||
axios.post(TEST_ENDPOINT, { | ||
client_id: CLIENT_ID, | ||
events: events | ||
}).then(res => { | ||
console.log(`statusCode: ${res.statusCode}`); | ||
console.log(res); | ||
}).catch(error => { | ||
console.log(error); | ||
}); | ||
} | ||
exports.testSendHit = testSendHit; |
{ | ||
"name": "ga4-mp", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Send data to Google Analytics 4 using Measurement Protocol", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"directories": {}, | ||
"scripts": { | ||
@@ -26,3 +24,8 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
"author": "Zach Mitchell", | ||
"license": "SEE LICENSE IN GA4-Measurement-Protocol-Typescript/LICENSE" | ||
"license": "SEE LICENSE IN GA4-Measurement-Protocol-Typescript/LICENSE", | ||
"dependencies": { | ||
"@types/node": "^14.14.6", | ||
"axios": "^0.21.0", | ||
"http": "0.0.1-security" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5049
78
3
+ Added@types/node@^14.14.6
+ Addedaxios@^0.21.0
+ Addedhttp@0.0.1-security
+ Added@types/node@14.18.63(transitive)
+ Addedaxios@0.21.4(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedhttp@0.0.1-security(transitive)