You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm have the understanding that every call to .activate that sends an impression via the events API by posting a decisions object within the visitors snapshots will result in my account being charged for an impression even though Optimizely dedupes the decisions table. Therefore, I've implemented logic inside a custom eventDispatcher.dispatchEvent function that adds experiment / variation metadata to local storage and on every activation call and subsequently checks all payloads in the event dispatcher call.
This is less than ideal and I don't think an onActivate event listener helps because it is just called when an activation event occurs but cannot block the actual activation. I'm wondering if there is an easier way with the SDK to prevent activation for a user that has been previously activated for a given experiment id and variation. I understand I could use getVariation for this type of thing but when using something like the React SDK where I don't have control over how the variation is retrieved I don't think that works?
What I expected to happen
Have an easy way via the SDK to avoid reactivating a previously activated user
What actually happened
Have to hack around in a custom event dispatcher which removes functionality such as the LocalStoragePendingEventsDispatcher and then parse through the visitors array to see if an activation event is included, and if so filter it out if the user has been previously activate.
What I wanted to do
I'm have the understanding that every call to
.activate
that sends an impression via the events API by posting adecisions
object within the visitors snapshots will result in my account being charged for an impression even though Optimizely dedupes the decisions table. Therefore, I've implemented logic inside a customeventDispatcher.dispatchEvent
function that adds experiment / variation metadata to local storage and on every activation call and subsequently checks all payloads in the event dispatcher call.This is less than ideal and I don't think an
onActivate
event listener helps because it is just called when an activation event occurs but cannot block the actual activation. I'm wondering if there is an easier way with the SDK to prevent activation for a user that has been previously activated for a given experiment id and variation. I understand I could usegetVariation
for this type of thing but when using something like the React SDK where I don't have control over how the variation is retrieved I don't think that works?What I expected to happen
Have an easy way via the SDK to avoid reactivating a previously activated user
What actually happened
Have to hack around in a custom event dispatcher which removes functionality such as the
LocalStoragePendingEventsDispatcher
and then parse through thevisitors
array to see if an activation event is included, and if so filter it out if the user has been previously activate.@optimizely/[email protected]
The text was updated successfully, but these errors were encountered: