Preact Integration

Segment makes it easy to send your data to Preact (and lots of other integrations). Once you've tracked your data through our open source libraries we'll translate and route your data to Preact in the format they understand.

Identify

To create users in in Preact you’ll use our identify method. Users must be identified on the client side for events to appear in Preact.

Group

To group users into accounts in preact you’ll use our group method.

Track

Our track method will record events in Preact. Users must be identified on the client side for events to appear in Preact.


Features

Recording Errors

Preact can be really useful for customer support. For that to work well you’ll want to send error events to Preact.

All you have to do is add a “!” as the first character in the event name and Preact will recognize it as an error event. Properties sent with the event will also show up in Preact.

Here’s a javascript example:

analytics.track('!Image upload error', {
    File size: '890kb',
    File extension: '.JPG',
    Message: 'File size too large'
    });

Settings

Segment lets you change these integration settings via your Segment dashboard without having to touch any code.

API Secret

Your API secret should be at least 10 characters long and look something like this: f1ment234j.

Project Code

Your project code should be at least 10 characters long, and look something like this: 3RnqzjTBwf.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!

Can receive data from
Mobile
Browser
Server