Segment Tracking Theme Component

This theme component allows you to send data about your site’s usage to Segment.

The component supports calling segment.identify when a user first logs on to the site. For site’s using SSO, you can either send the user’s Discourse ID, or their external_id to Segment. The component allow you to track views of the Discourse latest, categories, category, tag, and topic pages. It also allows you to track topic and post creation, likes, flags, and bookmarks.

Installation

Follow the How do I install a Theme or Theme Component? guide to install the component. Use https://github.com/scossar/discourse-segment-theme-component to install it directly from its Git repository. You can also download it from here.

Configuration

Add your Segment Write Key to the segment write key setting. Then select which events you would like to track:

The component extends your site’s content security policy to add https://cdn.segment.com/analytics.js/.

Let me know of any issues you run into with the component, or if there are ways that the data sent to Segment could be improved.

5 Likes