Set up an event stream for the SDK

To collect events with the SDK, turn on the SDK for an event stream. Amperity generates a public write key for the stream, and you use the write key and the collector URL to configure the SDK on your website.

Create an event stream for the SDK

To create an event stream for the SDK

  1. From the Events page, open Event streams.

  2. Add an event stream. The Event stream setup dialog opens.

  3. Enter a name for the event stream. Optionally, enter a description.

  4. Under Amperity Web SDK, select Allow collecting browser and mobile events with the Amperity SDK using a public key.

    A message explains that a public write key will be created for this stream, and the Amperity SDK Terms appear.

  5. Scroll to the end of the terms. The acceptance checkbox is available only after you reach the end. Select the checkbox to accept the terms.

  6. Select Create.

Amperity creates the event stream, records the acceptance of the terms for the stream, and generates the first write key. Amperity also sets the stream to recognize events by the SDK’s event field. Each event type that you add to the stream starts with the SDK’s eventId field as its event ID, so an event that the SDK sends more than once is applied once. Keep eventId as the event ID of every event type on the stream.

An event stream recognizes each event and resolves it to an event type. For how recognition works, see How events are processed.

Important

The Amperity SDK Terms include your commitments for consent. You agree to configure the SDK’s consent settings, to integrate the SDK with a consent management platform, and to pass the SDK your visitors’ refusals, withdrawals, and opt-outs. Read the terms before you accept them. See Consent.

Turn on the SDK for an existing event stream

You can also use the SDK with an event stream that you created earlier.

To turn on the SDK for an existing event stream

  1. From the Events page, open Event streams, and then open the event stream.

  2. Under Amperity Web SDK, select Allow collecting browser and mobile events with the Amperity SDK using a public key.

  3. Read and accept the Amperity SDK Terms.

  4. If the page shows This stream isn’t configured for the Amperity Web SDK, select Configure stream. This sets the stream to recognize events by the SDK’s event field and sets its default event ID to eventId, for every event that the stream receives.

  5. Save the event stream.

Amperity generates a write key for the stream. The event stream settings page shows the Endpoint and the Write keys that you use to configure the SDK.

To turn off the SDK for an event stream

  1. Open the event stream, and then clear the checkbox.

  2. Save the event stream, and then confirm that you want to revoke the write keys.

Turning off the SDK deletes every write key for the event stream. The collector stops accepting events that use those keys. If you turn the SDK on again, you must accept the terms again and use a new write key.