> For the complete documentation index, see [llms.txt](https://docs.edgetag.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgetag.io/implementation/http/event.md).

# Event

The URL for your endpoint is available in [our app dashboard](https://app.edgetag.io/).

### User

When sending events, make sure that you handle the user correctly. You have two options for connecting a user.

#### Via EdgeTag ID

If you have the option, it's preferred to store our EdgeTag ID (you can use our `getUserId` function) from the browser into your own system database. This way, when you send events from your system to EdgeTag, you will include them in the request headers  as  `EdgeTagUserId`.

<pre class="language-bash" data-title="With EdgeTag ID" data-overflow="wrap"><code class="lang-bash">curl --request POST \
  --url https://abc.domain.com/tag \
  --header 'Content-Type: application/json' \
<strong>  --header 'EdgeTagUserId: 138fffcd-ee39-4fd1-b5b5-760f07454407-1662025231518' \
</strong>  --data '{
	"data": {
		"value": 10.50,
		"currency": "USD",
		"contents": [
			{
				"id": "123123123",
				"quantity": 1,
				"item_price": 10.50,
				"title": "Summer Fun",
				"category": "bracelets",
				"image": "https://domain.com/product/fun-main.jpg",
				"url": "https://domain.com/summer-fun"
			}
		]
	},
	"eventId": "c2RrX3N0YXJ0-72a6410e-4b6d-4bfa-be5f-d17c294c73bc-1285.1000",
	"eventName": "AddToCart",
	"pageTitle": "T-Shirt",
	"pageUrl": "https://domain.com/product/shirt",
	"providers": {
		"all": true
	},
	"referrer": "https://google.com",
	"search": "?utm_campaign=online",
	"timestamp": 1671443880281,
	"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Brave",
	"storage": {
		"edgeTag": {
			"consent": {
				"all": true
			}
		}
	}
}'
</code></pre>

#### Via Email

If you only have an email, there's nothing to worry about. We can integrate the browser (online) with your offline system. Make sure that you provide an email in the payload through `userEmail` key.

<pre class="language-bash" data-title="With Email" data-overflow="wrap"><code class="lang-bash">curl --request POST \
  --url https://abc.domain.com/tag \
  --header 'Content-Type: application/json' \
  --data '{
	"data": {
		"value": 10.50,
		"currency": "USD",
		"contents": [
			{
				"id": "123123123",
				"quantity": 1,
				"item_price": 10.50,
				"title": "Summer Fun",
				"category": "bracelets",
				"image": "https://domain.com/product/fun-main.jpg",
				"url": "https://domain.com/summer-fun"
			}
		],
<strong>		"userEmail": "user@gmail.com"
</strong>	},
	"eventId": "c2RrX3N0YXJ0-72a6410e-4b6d-4bfa-be5f-d17c294c73bc-1285.1000",
	"eventName": "AddToCart",
	"pageTitle": "T-Shirt",
	"pageUrl": "https://domain.com/product/shirt",
	"providers": {
		"all": true
	},
	"referrer": "https://google.com",
	"search": "?utm_campaign=online",
	"timestamp": 1671443880281,
	"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Brave",
	"storage": {
		"edgeTag": {
			"consent": {
				"all": true
			}
		}
	}
}'
</code></pre>

### Sending Event

If you are sending standard events, please ensure that you follow our [standard events documentation](/overview/standard-events.md).

When consent is enabled, ensure that you include it in the request as well; see the examples above (`storage` key).

The Event ID should be unique to prevent signal loss.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.edgetag.io/implementation/http/event.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
