# extendify/3.2.1/src/Shared/lib/track.js

Extendify, version 3.2.1. 35 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Shared/lib/track.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/Shared/lib/track.js
- Modified: 2026-07-08T14:57:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Shared/lib/track.js#L10-L20`.

```javascript
import { INSIGHTS_HOST } from '@constants';
import { reqDataBasics } from '@shared/lib/data';

const HEADERS = {
	'Content-type': 'application/json',
	Accept: 'application/json',
	'X-Extendify': 'true',
};

const ENDPOINT = `${INSIGHTS_HOST}/api/v1/event`;

export const track = (key, payload = {}) => {
	if (!INSIGHTS_HOST || !key) return;
	const { siteId, partnerId, homeUrl, siteCreatedAt } = reqDataBasics;
	try {
		fetch(ENDPOINT, {
			method: 'POST',
			headers: HEADERS,
			keepalive: true,
			body: JSON.stringify({
				insightsId: siteId,
				key,
				payload,
				partnerId,
				siteURL: homeUrl,
				siteCreatedAt,
			}),
		}).catch(() => {
			/* swallow */
		});
	} catch (_e) {
		/* swallow */
	}
};

```
