Skip to content
This repository was archived by the owner on May 8, 2023. It is now read-only.

Latest commit

 

History

History
34 lines (25 loc) · 629 Bytes

File metadata and controls

34 lines (25 loc) · 629 Bytes

Targeting

Variate must to be reinitalize between each page / view change to target experiments correctly. This can be done in the provider by calling active in the onViewChange or by calling initialize on the variate config object.

With onViewChange

<VariateProvider
  onViewChange={activate => { 
    activate({ view: window.location.pathname });
  }
}>
  ...
</VariateProvider>

Without onViewChange

const App = () => {
  <VariateProvider>
    (({ variate }) => {
      variate.initialize({ view: window.location.pathname })
      return (
        ...
      )
    })
  </VariateProvider>
}