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

Standardize support for Firebase products that integrate with Remote Config. #7094

Merged
merged 7 commits into from
Jan 20, 2021

Conversation

vic-flair
Copy link
Contributor

No description provided.

FirebaseRemoteConfig/Sources/RCNPersonalization.m Outdated Show resolved Hide resolved
return;
}

// This gets dispatched to a serial queue, so this is OK. But even if not, it'll just possibly log
// more.
if (self->_armsCache[key] == personalizationId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean we only want to log each arm once?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to log at least once. We can do de-duping on the back-end.

@vic-flair vic-flair changed the title Add support for other Firebase products to integrate with Remote Config. Improve support for Firebase products that integrate with Remote Config. Jan 12, 2021
@vic-flair vic-flair changed the title Improve support for Firebase products that integrate with Remote Config. Standardize support for Firebase products that integrate with Remote Config. Jan 12, 2021
Copy link

@erikeldridge erikeldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems technically correct to me 👍 I dropped a couple comments re event field naming to improve readability, but since they concern naming, which can be contentious, I flagged them as minor. To avoid miscommunication, I'll defer formal approval to @karenyz, since she's the iOS lead.

static NSString *const kArmKey = @"_fpid";
static NSString *const kArmValue = @"_fpct";

static NSString *const kAnalyticsPullEvent = @"personalization_assignment";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: as I commented on the Android change, it's unclear to me what "pull" means here and below.

Also, given this whole file concerns logging to Analytics, including "Analytics" in some field names, but not others is confusing. I'd vote to just omit it.

The main distinctions from my perspective are internal vs external, and "event" vs "param" (to use Analytics' "feature type" nomenclature from the event proposal).

To summarize, I'd vote to use "internal" and "external" prefixes to differentiate internal from external events, and "event" and "param" suffixes to differentiate event names from param names, eg kInternalEvent, kInternalChoiceIdParam, etc

Thinking (no action req'd): all these field names are consistent across Android and iOS 👍

FirebaseRemoteConfig/Sources/RCNPersonalization.h Outdated Show resolved Hide resolved
kArmValue : values[key].stringValue,
kPersonalizationIdLogKey : metadata[kPersonalizationId],
kArmIndexLogKey : metadata[kArmIndex],
kGroup : metadata[kGroup]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking: the design lists five things we want to log:

  1. Developer friendly identifier of the personalization (either the rc param, or an id customers can map back to rc param), satisfied by the arm_key field
  2. The choice that was made (a string value), satisfied by the arm_value field
  3. The group the user was in (“p13n” or “baseline”), satisfied by the group field
  4. Personalization ID, satisfied by the personalization_id field
  5. Arm index, satisfied by the arm_index field

Thinking: the external event name is arbitrary, we just need to document what it is. personalization_assignment seems self-descriptive to me 👍

Minor: renaming arm_key to something like rc_parameter would be more self-descriptive given it communicates an RC parameter. Likewise, renaming the key arg passed to logArmActive to rcParameter would clarify its purpose.


[self->_analytics logEventWithOrigin:kAnalyticsOriginPersonalization
name:kAnalyticsPullEventInternal
parameters:@{kChoiceIdLogKey : choiceId}];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking: the design lists one thing we want to log in the internal event:

  1. Choice ID, satisfied by the _fpid param

Thinking: the _fpc event name is correct per the events proposal.

FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m Outdated Show resolved Hide resolved
return;
}

// This gets dispatched to a serial queue, so this is OK. But even if not, it'll just possibly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little unclear what the "this" refers to. Can you clarify? Does it mean that loggedChoiceIds may not have been updated yet and a duplicate entry may be logged? What makes it serial?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This" refers to this function. It has to do with how iOS handles async stuff. A serial queue means that functions are executed serially, which isn't always the case. Do you have any suggestions on how to make it clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of "Listeners like logArmActive are dispatched to a serial queue, so loggedChoiceIds should contain any previously logged RC Parameter/Choice ID pairs."

@vic-flair vic-flair merged commit 899b562 into master Jan 20, 2021
@paulb777 paulb777 deleted the vlum.p13n-2 branch January 28, 2021 04:21
@firebase firebase locked and limited conversation to collaborators Feb 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants