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

fix: appsflyer attribution #547

Merged
merged 3 commits into from
May 23, 2022
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
15 changes: 9 additions & 6 deletions packages/core/src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {
Context,
DeepPartial,
GroupTraits,
IntegrationSettings,
JsonMap,
PluginType,
SegmentAPIIntegrations,
SegmentAPISettings,
SegmentEvent,
UpdateType,
UserInfoState,
Expand Down Expand Up @@ -351,20 +351,23 @@ export class SegmentClient {

/**
* Adds a new plugin to the currently loaded set.
* @param {{ plugin: Plugin, settings?: SegmentAPISettings }} Plugin to be added. Settings are optional if you want to force a configuration instead of the Segment Cloud received one
* @param {{ plugin: Plugin, settings?: IntegrationSettings }} Plugin to be added. Settings are optional if you want to force a configuration instead of the Segment Cloud received one
*/
add({
add<P extends Plugin>({
plugin,
settings,
}: {
plugin: Plugin;
settings?: Plugin extends DestinationPlugin ? SegmentAPISettings : never;
plugin: P;
settings?: P extends DestinationPlugin ? IntegrationSettings : never;
}) {
// plugins can either be added immediately or
// can be cached and added later during the next state update
// this is to avoid adding plugins before network requests made as part of setup have resolved
if (settings !== undefined && plugin.type === PluginType.destination) {
this.store.settings.add((plugin as DestinationPlugin).key, settings);
this.store.settings.add(
(plugin as unknown as DestinationPlugin).key,
settings
);
}

if (!this.store.isReady.get()) {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/plugin-appsflyer/src/AppsflyerPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class AppsflyerPlugin extends DestinationPlugin {
},
};

if (is_first_launch === 'true') {
if (JSON.parse(is_first_launch) === true) {
if (af_status === 'Non-organic') {
this.analytics?.track('Install Attributed', properties);
} else {
Expand Down