Heap Analysis - only first value of custom event properties is tracked

  • 8 March 2023
  • 1 reply

    export function useHeapAddEventCaseCode(caseData?: CaseEntity) {
      return useEffect(() => {
        if (caseData?.code) {
          // As a best practice, we recommend calling clearEventProperties before addEventProperties on every page
          window.heap.addEventProperties({ caseCode: caseData.code })
      }, [caseData])

I'm using this effect on React SPA app in some page. Somehow it's only track first value, never see any other value even though I tried other case codes

heap array in console.log has other caseCode but none of those is sent to heap analysis or not appear



Best answer by Rohin-Heap 11 March 2023, 00:34

View original

1 reply

Userlevel 2
Badge +1



Happy to help answer here, the addEventProperty code will adjust the cookie values and then future events will be changed based on the cookie value.  For testing this you can check the storage of the browser and see what the current values.  The cookie is always hp2_props_<env_id>.  From this we’ll want to see if the cookie resetting is happening properly or if something is interfereing with it. 

Alternatively if you can supply your URL I’m happy to take a closer look.