auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
var axios = require('axios');
var data = JSON.stringify({
"client_id": steps.trigger.event.query.gacid,
"events": [
{
"name": "sucess_lead",
"params": {
"foo": "bar",
"cost": steps.trigger.event.query.cost
}
}
]
});
var config = {
method: 'post',
url: `https://www.google-analytics.com/mp/collect?measurement_id=${process.env.measurement_id}&api_secret=${process.env.api_secret}`,
headers: {
'Content-Type': 'application/json'
},
data : data
};
await axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});