# How to send http request to Google Analytics properly?

**URL:** https://discourse.nodered.org/t/how-to-send-http-request-to-google-analytics-properly/7837
**Category:** General
**Created:** [11 February 2019 16:47 UTC](https://discourse.nodered.org/t/how-to-send-http-request-to-google-analytics-properly/7837 "2019-02-11T16:47:22Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [11 February 2019 16:55 UTC](https://discourse.nodered.org/t/how-to-send-http-request-to-google-analytics-properly/7837/2 "2019-02-11T16:55:37Z")

</div>

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:

```auto
https://www.google-analytics.com/batch?v={{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.

---

_[View the full topic](https://discourse.nodered.org/t/how-to-send-http-request-to-google-analytics-properly/7837)._
