How to send http request to Google Analytics properly?


I'm trying to sent data to Google Analytics via http request. I need to send this type of request using POST:

POST /batch HTTP/1.1


What type of node should I use? How do I trigger this each time the value changes? Thanks!


Hi @Traste

The HTTP Request node is the one you want to use to send http requests.

You can configure the type of the request (POST) in the node's edit dialog.

If the only part of the url that changes is v=1, then you could then configure the URL field of the node to be:{{payload}}&tid=UA-XXXXX-Y&cid=555&t=event&ec=sensor_name&ea=sensor_state&ev=sensor_value

Note how I have replaced the 1 in your example with {{payload}}. That means the node will insert the value of msg.payload into the url before sending the request.

So whenever your value changes, set msg.payload to the value and pass it to the HTTP Request node.


Great answer! It does work flawlessly. Actually, I made a mistake and this is the right URL I had to use:

Only thing... taking into account I have around 30 entities and several state changes per minute: could this affect stability and speed when running flows?