analytics icon indicating copy to clipboard operation
analytics copied to clipboard

Problem using two separated identify calls

Open lucas-av7 opened this issue 2 years ago • 1 comments

I have two plugins installed:

  • Google Analytics
  • Pendo (created by me)

I need to have two different calls to the identify method, one for google analytics and one for Pendo.

I make the first call using the following logic:

  plugins: {
    all: false,
    "google-analytics": true
  }

In the second call I'm using the following logic:

  plugins: {
    all: false,
    pendo: true
  }

Error:

It seems that Analytics stores the traits object in the local storage, so when I make the identify call for Pendo, it saves the treats in the local storage, if I refresh the page, the identify call for google analytics will send the Pendo treats to Google Analytics.

lucas-av7 avatar Jul 26 '23 18:07 lucas-av7

Yeah this is how the library works right now.

I think we'd need an option to identify to not persist traits like:

analytics.identify('xyz-123', {}, {
  plugins: {
    all: false,
    pendo: true
  },
+  persist: false
})

Will need to think about this one on how to implement

DavidWells avatar Dec 11 '24 22:12 DavidWells