BumbleB Crunch™ answers questions about what people do on your site from your site’s events. If you do not use Google Tag Manager, or you would rather keep the code in your own pages and build, you can load the same events code two other ways: a script tag, or the npm package. Both send to the same source you would set up for Tag Manager. What the code collects is set out in What we collect.
What you’ll need
The same things as Connect your website with Google Tag Manager:
- A role that can manage connections, and Sources in BumbleB Crunch — see Roles.
- A paid plan; see pricing.
- Access to your domain’s DNS settings, to verify the domain. Data starts arriving only once a domain is verified — see Verify your domain.
- Access to your site’s pages (for the script tag) or its code (for npm).
Step 1: Create the source, verify the domain and keep the key
Follow steps 1 and 2 of the Tag Manager guide: in Sources, then Connections, click Add a source, choose Website, name it, check the Stream name, enter your Website domain, and create it. Copy the API key shown once under Keys, then verify the domain on the setup page.
Step 2: Choose how to install
On the source’s setup page, Install the code offers Script tag, npm and Google Tag Manager. Pick one. While the new key is still shown, it is already in the code. If not, paste the key you saved where the code has the placeholder, or click Make a new key.
Script tag
Paste the code from the panel into the <head> of every page. It is one tag that loads the events script
and carries your key in its data-key attribute:
<script async src="https://ingest.bumbleb.co/sdk/v1/events.js" data-key="YOUR_API_KEY_HERE"></script>
npm
In your project, install the package:
npm install @bumbleb/events
Then start it once, as your app starts, in the browser. Copy the code from the panel: it has your key, and it is the version to use.
import { init } from '@bumbleb/events';
const bb = init({ key: 'YOUR_API_KEY_HERE', appVersion: '1.0.0' });
Step 3: Say who is using your site, and what they do
With npm, the calls below are on the object init returns. The panel’s code shows each of them.
bb.identify(user.id)— after sign-in, to tie events to a user.bb.group(user.companyId)— after sign-in, to tie events to the user’s company or account.bb.reset()— at sign-out, so the next person is not tied to the last.bb.track('purchase', { value: 49, currency: 'USD', order_id: 'A-1001' })— a named event with properties.
If your events carry an email or phone number, see Hashing user IDs.
Tip: keep the utm_ parameters on your ad links. They carry the campaign name, which is how BumbleB
Crunch later ties a visit back to the ad that brought it.
How to tell it worked
- The source’s page says “Live: events are arriving.” once the domain is verified and events get through.
- Each API key shows “used N min ago”. It only updates when an event is accepted.
- Ingest health shows the last event and any problems of the last 7 days, with what to do.
Good to know
- All three ways load the same events code. Settings you change on the source, such as session replay and user-ID hashing, are read by the code when the page loads, so a change takes effect on the next page load with no need to paste the code again.
- Browser only is a switch under the install code. When on, events are accepted only from a web browser on your verified sites. Turn it off if you send events from a server.
Related
- Connect your website with Google Tag Manager — the other way to install, with the same first steps.
- Which route for which data — other ways to bring data in.
- Fixes — when events aren’t arriving.