From dee55907f96f6e56606156c9fdb66e154e6a19a8 Mon Sep 17 00:00:00 2001 From: Brett Snaidero Date: Mon, 26 Nov 2018 16:06:43 +1100 Subject: [PATCH 1/2] Impression tracking note - Added note on impression tracking to README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 453baca..127a6d2 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,14 @@ An empty `Array` will move the current user into the control group. Gets the props for the current variant from the groupVariants. +## Impression tracking + +When the experiment props are received, the React component will remount, so any impression tracking events inside the component may be executed again (if they are in any lifecycle methods like `componentDidMount`). + +To avoid recording duplicate impressions, consider ways to mitigate this: +- Adding a flag as a global variable to check if 'load' events have been fired before +- Moving impression events outside of the experiment (into a wrapping component) + ## Changes and history See [CHANGELOG.md](./CHANGELOG.md). From a08f91bb9a173df631fbb65bb4d1242b3aea0f22 Mon Sep 17 00:00:00 2001 From: Brett Snaidero Date: Mon, 26 Nov 2018 16:11:36 +1100 Subject: [PATCH 2/2] Improve wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 127a6d2..a3ef269 100644 --- a/README.md +++ b/README.md @@ -274,7 +274,7 @@ Gets the props for the current variant from the groupVariants. When the experiment props are received, the React component will remount, so any impression tracking events inside the component may be executed again (if they are in any lifecycle methods like `componentDidMount`). To avoid recording duplicate impressions, consider ways to mitigate this: -- Adding a flag as a global variable to check if 'load' events have been fired before +- Adding a flag as a global variable to check if 'mount' events have already been fired - Moving impression events outside of the experiment (into a wrapping component) ## Changes and history