Analytics and versioning
What the Givebear SDK tracks (nothing, by design), and how the bundle is versioned and served.
This page documents the SDK's analytics surface and how the script is versioned.
For loading the SDK and calling its methods, see Installation and API. For every config field, see Configuration reference.
Analytics
The SDK does not emit analytics. It does not send beacons, set cookies, or call any analytics endpoint. No event leaves the visitor's browser.
The window.Givebear.track method exists, but it is a no-op. It accepts its
arguments and returns without doing anything. It is kept so older embeds that
call it keep working without errors.
The web-donation analytics beacon and its backing store were removed. The
track method and its event names survive only for backwards compatibility.
The track method
Prop
Type
The event argument is typed as TrackEvent, a union of the strings the SDK's
own widgets pass plus any other string:
widget_viewwidget_clickmodal_openmodal_close
Some built-in widgets call track internally at these moments (for example the
donation button passes widget_view then widget_click with a placement
value). Because track is a no-op, those calls have no effect.
Attributing donations instead
To attribute donations to a connected app rather than to record client-side
events, use Givebear Connect. Pass appId to a render method, or set
data-app-id on an auto-mounted element, and donations are credited to
that app.
<script async src="https://givebear.io/sdk/givebear.js"></script>
<div
data-givebear-button
data-organization-id="YOUR_ORG_ID"
data-app-id="YOUR_APP_CLIENT_ID"
></div><div id="gb-button"></div>
<script>
window.Givebear = window.Givebear || function (cb) {
(window.Givebear.q = window.Givebear.q || []).push(cb);
};
</script>
<script async src="https://givebear.io/sdk/givebear.js"></script>
<script>
window.Givebear(function (gb) {
gb.renderButton("#gb-button", {
organizationId: "YOUR_ORG_ID",
appId: "YOUR_APP_CLIENT_ID",
});
});
</script>import { DonateButton } from "@givebear/react";
export function Donate() {
return (
<DonateButton
organizationId="YOUR_ORG_ID"
appId="YOUR_APP_CLIENT_ID"
/>
);
}See Connect overview and the Connect reference for how attributed donations appear on the API.
Versioning
The SDK reports its version through window.Givebear.version. The current value
is 2.1.0.
Prop
Type
There is no versioned URL path. Givebear serves one rolling bundle at the same URL, and the bundle is upgraded in place. You always load the latest published version.
The dashboard snippet generators append a ?sdkver=2.1.0 query string to the
script URL. This value tracks SDK_VERSION and only busts the browser cache; it
does not select a pinned version.
Load the script with async and either call methods inside the
window.Givebear(function (gb) { ... }) callback or push to the
window.Givebear.q queue. The bundle drains queued callbacks once it loads.
See Installation and API.