Integrations

PostHog integration

RightMessage automatically sends enriched event data to PostHog when you enable the integration. This lets you track widget interactions, form submissions, campaign exposures, and ESP syncs alongside your other product analytics in PostHog.

Events include human-readable names for offers, questions, segments, and campaigns—resolved from your RightMessage configuration—so you can analyze funnel performance without cross-referencing IDs.

You'll need a PostHog account with a client-side API key and the PostHog JavaScript library loaded on your site before the RightMessage snippet.

Setting up the integration

Install the PostHog JavaScript library on your site before your RightMessage tracking script.

Next, enable the integration in RightMessage:

  1. Go to Integrations in your RightMessage dashboard

  2. Find PostHog in the Analytics section

  3. Toggle the integration to Enabled

  4. Click Publish changes to update your tracking script

Once published, RightMessage will automatically send events to PostHog on your next page loads.

Events sent to PostHog

RightMessage sends these events to PostHog as visitors interact with your widgets and campaigns:

Widget and offer events

  • rm_offer_displayed — An offer was shown to a visitor. Includes offer name, widget type, flow name, and whether it's a lead capture form.

  • rm_widget_dismissed — A visitor closed a widget (e.g., dismissed a popup or notification bar).

Question and answer events

  • rm_question_displayed — A question was shown in a quiz or survey flow.

  • rm_question_answered — A visitor answered or skipped a question. Includes the question name, segments triggered, and any freeform input.

Form submission events

  • rm_form_submitted — A visitor successfully submitted a lead capture form. Includes widget, offer, and flow details.

Campaign events

  • rm_campaign_exposure — A visitor saw personalized content from a campaign. Includes campaign name, applied segments, and whether the visitor was in a holdback group.

  • rm_campaign_conversion — A visitor completed a campaign goal.

ESP sync events

  • rm_set_custom_field — RightMessage updated a custom field in your email platform (e.g., from a quiz answer sync). Includes field name, value, and source.

  • rm_add_tag — RightMessage added a tag to a contact in your email platform.

  • rm_remove_tag — RightMessage removed a tag from a contact.

All events include properties prefixed with rm_ and use human-readable names resolved from your RightMessage configuration (e.g., rm_offer_name: "Free Guide Download" instead of just an ID).

Visitor identification

When RightMessage identifies a visitor through your email platform integration, it calls posthog.identify() with the visitor's email address and enriched profile data:

  • rm_visitor_id — RightMessage's internal visitor ID

  • rm_email — The visitor's email address

  • rm_segments — Array of segment names the visitor belongs to

  • rm_tags — Array of tags from your email platform

  • rm_lists — Array of lists the contact is subscribed to

  • rm_custom_fields — Object containing custom field key-value pairs

This merges the RightMessage visitor with the PostHog person record using their email as the distinct ID. Anonymous events sent before identification are automatically linked once the visitor is identified.

Important notes

  • PostHog must load first — The PostHog script must be present on the page before the RightMessage snippet runs. If PostHog isn't detected, events are silently skipped without breaking your site.

  • Widget visibility required — Events only fire for widgets that have been displayed to the visitor.

  • No proxy configuration — The integration uses the global posthog object from your site. If you need a custom PostHog host or proxy, configure it in your PostHog initialization script.

  • Automatic updates — Once enabled, your snippet automatically includes the PostHog integration code. No manual script changes needed.

Was this helpful?