in.maqetin.com, a visitor who uses it sends nothing: no events reach the profile and no journey starts for them. Calls from your server are not affected. On a web page, send through a path on your own site and let your server forward it.
1
Choose a path your site does not use
This page uses
/relay. Use a short word that says nothing about what the path does.2
Forward the batch route
Forward
POST /relay/v1/batch to https://in.maqetin.com/v1/batch, following the rules below.3
Give the path as endpoint
The SDK adds
/v1/batch to it.- Blocker lists also match paths. Do not put
track,analytics,collectorpixelin the path, and do not name it after an analytics product, Maqetin included. - You cannot change the
/v1/batchpart of the request path. A full address on the page’s own origin, such ashttps://brand.example/relayfor a page onhttps://brand.example, works the same way. - A path works on a web page only; in Node, give the full address. The page sends to its own origin, so the browser makes no cross-origin request and no CORS preflight.
Proxy rules
The proxy must:- Forward
POST <path>/v1/batchasPOST /v1/batchonin.maqetin.com. The gateway matches/v1/batchexactly: lower case, no trailing slash. - Send
Host: in.maqetin.com, and the TLS namein.maqetin.comover HTTPS. - Keep the
Authorizationheader (it holds the key), theContent-Typeheader and the body unchanged. - Return the gateway’s status,
Retry-Afterheader and body unchanged. - Accept a request body of 512 KiB or more. The SDK keeps a batch under about 480 KB; the gateway refuses more than 512 KiB.
- Cache the answer.
- Retry on its own. The SDK already retries with backoff and the same message ids; a second layer multiplies the load while Maqetin is slow and hides the 429 from the SDK.
- Log the body. It holds your visitors’ data.
X-Forwarded-For and similar). The gateway does not read it, and it limits requests per key.
The SDK retries on 5xx, 429 and network errors, waiting for Retry-After up to retryMaxMs. If the proxy answers 200 for a batch Maqetin did not accept, the SDK takes the events as sent and reports nothing. If it answers another 4xx in place of a 429, the SDK drops the events and reports them to onError.
Check it works
Open your site and cause one event. In the browser’s network tab, find thePOST to /relay/v1/batch; it must go to your own domain.