Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Omitting Impression Event on Activate When User Previously Activated #657

Open
dtothefp opened this issue Mar 3, 2021 · 2 comments

Comments

@dtothefp
Copy link

dtothefp commented Mar 3, 2021

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 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.

@optimizely/[email protected]

@mikechu-optimizely
Copy link
Contributor

@dtothefp Thanks for the suggestion.

To be honest, I'm going to have to discuss this in a stand-up meeting. Back with you by next week (latest).

cc @jaeopt

@mikechu-optimizely
Copy link
Contributor

I've created a spike/research ticket (FSSDK-9619) for this Issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants