Skip to content

Apply correct transformation for Products Searched event #33

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

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static Map<String, String> createEventMap() {
EVENT_MAPPER.put("Product Added to Wishlist", Event.ADD_TO_WISHLIST);
EVENT_MAPPER.put("Product Shared", Event.SHARE);
EVENT_MAPPER.put("Product Clicked", Event.SELECT_CONTENT);
EVENT_MAPPER.put("Product Searched", Event.SEARCH);
EVENT_MAPPER.put("Products Searched", Event.SEARCH);
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to add a new mapper for Products Searched, rather than replacing the previous one? im guessing customers might be using Product Searched currently and this change would break that flow

Copy link
Contributor

@prayansh prayansh Mar 4, 2021

Choose a reason for hiding this comment

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

nvm, seems like the correct and only one to use is Products Searched (ref: https://github.com/segment-integrations/analytics-ios-integration-firebase/blob/master/Segment-Firebase/Classes/SEGFirebaseIntegration.m#L104), so its ok to replace here

return EVENT_MAPPER;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ public void trackWithEventNameTransformation() {
verify(firebase).logEvent(eq("foo_bar"), bundleEq(expected));
}

@Test
public void productsSearchedTransformation() {
integration.track(new TrackPayload.Builder().anonymousId("12345").event("Products Searched").build());
verify(firebase).logEvent(eq("search"), bundleEq(new Bundle()));
}

@Test
public void trackScreenWithName() {
final Activity activity = PowerMockito.mock(Activity.class);
Expand Down