By default, the Web SDK sends beacon events via HTTP GET with the event payload encoded in the URL query string. When usePostForEvents: true is set, the SDK switches to HTTP POST, placing the payload in the request body instead.
|
Behavior |
GET (default) |
POST (with flag enabled) |
|---|---|---|
|
Payload location |
URL query string |
Request body |
|
Content-Type |
N/A (image pixel / query params) |
application/x-www-form-urlencoded |
|
Affected endpoints |
All beacon endpoints |
All beacon endpoints |
|
Server-side handling |
No change needed |
No change needed |
When enabled, all Web SDK beacon endpoints switch from GET to POST:
|
Endpoint |
Purpose |
|---|---|
|
/api2/event/:dataset |
Main event API (interactions, page views) |
|
/pr |
Ping / time-on-page heartbeat |
|
/msreceiver |
Campaign stat reporting |
|
/er |
Client-side error reporting |
Add usePostForEvents: true to your sitemap initialization config.
Via configure:
Evergage.configure(endpointConfig, {
Via init:
When the flag is not set or is false: No change. The SDK continues to use GET by default, with automatic fallback to POST only for oversized (>8KB) or non-ASCII payloads. This is the existing behavior for all current customers.
When the flag is true: All beacon requests use POST regardless of payload size.
With POST mode, event payloads (user identifiers, behavioral data, interaction details) are sent in the request body rather than in URL query parameters. Request bodies are not recorded by intermediate infrastructure such as load balancer access logs, corporate proxy logs, or browser history. This can simplify compliance with data handling policies that require minimizing where identifiable information is persisted.
GET requests are subject to URL length limits that vary by browser and infrastructure (typically 2KB–8KB). POST removes this constraint entirely, allowing richer event payloads without risk of truncation.
Organizations subject to security audits or data protection policies (GDPR, CCPA, PCI-DSS) may have requirements around how data appears in transit logs. POST mode satisfies policies that flag query-string transmission of identifiable data.
The SDK uses various techniques to ensure events fire reliably when a user navigates away from or closes a page. GET requests via image pixel have historically had strong browser support during page teardown. POST requests rely on navigator.sendBeacon() and keepalive fetch for the same reliability. These APIs are well-supported in modern browsers but are subject to a shared 64KB budget for in-flight keepalive requests. In most scenarios this is not a practical concern, but pages that fire a very high volume of simultaneous events during unload should be aware of this limit.
POST requests with certain content types may trigger a CORS preflight (OPTIONS) request, adding one additional network round-trip before the actual event is sent. The SDK uses application/x-www-form-urlencoded to avoid preflight in most cases, but environments with custom CORS configurations should verify that beacon requests complete without issues.
GET image-pixel requests are generally less visible to ad blockers and browser extensions than XHR/fetch POST requests. In environments where users have aggressive content-blocking extensions, there is a small possibility that POST beacon requests may be intercepted. This is uncommon for first-party beacon domains but worth noting for completeness.
GET image pixels require the beacon domain in img-src, while POST requests require it in connect-src. If your site uses a strict Content Security Policy, ensure the beacon domain is included in the connect-src directive.
With GET, the full event payload is visible in load balancer access logs (e.g., AWS ALB logs queryable via Athena), which can be useful for debugging. With POST, access logs will show the endpoint path but not the request body. This is the intended behavior of the feature, but support and engineering teams should be aware that log-based debugging of specific events will require alternative approaches.
You can verify the setting is working by inspecting the browser Network tab:
Open DevTools and go to the Network tab.
Filter requests by the beacon endpoints: event, pr, msreceiver, or er.
Trigger SDK activity (navigate a page, wait for a ping timer, etc.).
Check:
Method column should show POST (not GET).
Request URL should have no query string payload (just the path).
Payload / Request Body tab should show the form-encoded event parameters.
The flag is purely client-side and opt-in. To revert to GET behavior, remove usePostForEvents: true from the sitemap config and redeploy. No server changes are needed.
Q: Does this affect the mobile SDKs (iOS/Android)? A: No. This flag only applies to the Web SDK beacon. Mobile SDKs use different transport mechanisms.
Q: Can I enable this for only some endpoints (e.g. just the event API)? A: No. The flag applies to all beacon endpoint types. When enabled, all four switch to POST.
Q: What happens if I set usePostForEvents: true on an older SDK version that doesn't have this feature? A: The flag will be silently ignored. The SDK will continue using GET as before. There is no error or breakage.
Q: Does this interact with the isReadableEvent debug parameter? A: Both independently cause POST to be used. If usePostForEvents is true, it takes effect regardless. The isReadableEvent=true URL parameter continues to work as a separate debug mechanism.
Q: Are there any performance impacts? A: In practice, the difference is negligible for typical beacon payloads. HTTP POST sends the payload in the request body rather than the URL, which may involve a minor difference in TCP packet sequencing, but this is not observable in real-world usage.
005321713

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.