Integrating LogRocket with Segment

Add a LogRocket session recording URL to Segment

LogRocket.getSessionURL(function (sessionURL) {
  analytics.track('LogRocket', {
    sessionURL: sessionURL,

Custom Analytics Events

To send all of your Segment events to LogRocket for search (via LogRocket.track()), you can do EITHER of the following:

  1. Redefine to also send data to LogRocket
if ( {
   const oldTrack =; = (...args) => {

You can do the same for .identify events as well.

  1. Instead of (1), you can could also build a utility method that calls both and LogRocket.track
function analyticsTrack(...args) {;


Please Note

LogRocket can act as a Segment Source but can not be configured as a Segment Destination