Skip to help content
RightMessage

Send events and contact data to PostHog

You'll see RightMessage interactions alongside your other PostHog events, with contact details attached when RightMessage knows the visitor's email.

Updated

View as Markdown

See how visitors interact with your RightMessage questions and offers alongside the rest of their activity in PostHog. For identified visitors, you can also send contact data to help you understand who took each action.

Install and initialize PostHog's JavaScript library before the RightMessage interactions you want to capture happen. You'll also need the RightMessage snippet, permission to edit and publish your project, and access to incoming events in PostHog.

RightMessage uses the page's existing posthog object. The switch doesn't install PostHog or ask for its API key. Your website's consent and data-handling settings still apply.

Turn on forwarding

  1. In RightMessage, open Project settings (the gear at the bottom of the sidebar), then Integrations.
  2. Choose the Analytics tab.
  3. Turn on the PostHog switch.
  4. Review and publish your changes.
  5. Open your website and answer a question.
  6. Find rm_question_answered in PostHog's incoming events and check its properties.
Analytics tab of Integrations with switches for Google Analytics, Fathom Analytics, PostHog and Google Tag Manager, with Google Tag Manager onOriginal
Analytics tab of Integrations with switches for Google Analytics, Fathom Analytics, PostHog and Google Tag Manager, with Google Tag Manager on

To stop sending future RightMessage events, turn the switch off and publish again. This leaves PostHog's library and previously collected events in place.

Find your RightMessage events

PostHog receives these events when the corresponding interaction happens:

  • rm_offer_displayed when an offer is displayed.
  • rm_question_displayed when a question is displayed.
  • rm_question_answered when a question is answered.
  • rm_form_submitted when a form is submitted.
  • rm_campaign_exposure and rm_campaign_conversion for campaign events.
  • rm_widget_dismissed when a widget is dismissed.
  • rm_splittest_assigned for split-test assignment.
  • rm_experience_impression each time RightMessage counts the visitor in an A/B test version, holdback, or split test. See below.
  • rm_set_custom_field, rm_add_tag, and rm_remove_tag for the corresponding integration events.

Event properties use snake_case with an rm_ prefix. For example, questionId becomes rm_question_id. They include available resource names, such as question names. The exact properties depend on the event.

These names are specific to PostHog. Google Analytics and Fathom use different names. If you're testing a form, check the contact record in your email platform too. The form event doesn't confirm every provider action succeeded.

A/B test impressions

rm_experience_impression is a custom exposure event for PostHog experiments. Its properties are:

  • $feature/rm-<experienceId>: the version ID, such as control. PostHog experiments read this property.
  • rm_experience_id, rm_experience_kind, rm_experience_name, rm_variant_id, rm_variant_name, and rm_campaign_id or rm_resource_id when there is one.
  • exp_variant_string: RM-<experienceId>-<variantId>.

Each test's Send to your analytics panel on the campaign's Testing tab shows its PostHog feature flag key. Impressions go only to an enabled, published PostHog app, and aren't sent for an excluded browser, in previews or debugger sessions, or before cookie consent. See analyze tests in PostHog.

Check that contacts are identified

  1. In a clean browser, follow your configured identification steps with a test contact you control.
  2. Inspect that person's PostHog identity and properties.
  3. Confirm the expected email and RightMessage visitor ID.

When RightMessage has an email address, it uses that email as the PostHog distinct ID and sends rm_visitor_id and rm_email. Available segment IDs, tag names, list names, and custom fields go into rm_segments, rm_tags, rm_lists, and rm_custom_fields.

Without an email, this integration doesn't identify the visitor in PostHog. List names are identity properties, not separate list-membership events.

When you can see the test interaction and the expected contact properties in PostHog, forwarding is working.

If events aren't arriving

  1. Check that you've published the enabled switch.
  2. Check that posthog.capture is available on the page when the interaction happens.
  3. For identification, check that posthog.identify is available and RightMessage has the visitor's email.
  4. Review script blocking, consent settings, and PostHog's setup.

RightMessage skips delivery if the required PostHog function isn't available, and catches delivery errors. There's no queue or replay control for missed events. Test on your website, not just in a dashboard preview.

Still need a hand?

Tell us what you’re trying to do and where you’re getting stuck.

support@rightmessage.com