Closed Mik77o closed 1 year ago
Are you talking about Application Installed
event?
https://segment.com/docs/connections/spec/mobile/#application-installed
Yes :)
On Android, this type of event is tracked. Maybe it's related to this: https://developer.apple.com/app-store/user-privacy-and-data-use/ Asking permissions to track
What do you think?
@danielgomezrico, I tried to add tracking permissions via app_tracking_transparency but still this event is not being tracked in the Segment.
I don't think so,
It is not because this event is not being tracked in the Segment
, the event tracked by segment already, you can test it.
I've tested it.
As you can see, it was happened because in the default event like "Application Installed" never send fields adTrackingEnabled
and advertisingId
. Refer to docs :
I checked too for iOS and the events exists 🤔
What else could be missing on your setup?
@danielgomezrico Yes, the event exists, I think the problem is about IDFA. in some case such as facebook, the event will not received without IDFA
@ariefwijaya, could you please include a snippet of code, what should the configuration look like in the Segment for Flutter app when using the advertising_id and flutter_segment plugin? :)
I prefer use facebook_app_events together with flutter_segment, so it will solve the problem without many boilerplate
@ariefwijaya @danielgomezrico How was advertisingId added manually? I added something like this on the Flutter side.
SegmentDefaultOptions.instance.options = {
'context': {
'device': {
'adTrackingEnabled': true,
'advertisingId': advertisingId,
}
}
};
Some of the fields for device
field that were visible before are no longer present. It looks like the device
part has been overwritten. Only the type: ios
left.
From Segment:
before my changes
"device": {
"id": "test",
"manufacturer": "test",
"model": "test',
"name": "test",
"type": "ios"
},
now (Adding a configuration manually)
"device": {
"adTrackingEnabled": true,
"advertisingId": "00000000-0000-0000-0000-000000000000",
"type": "ios"
},
Yes, but it won't delete any other value except the one we want to overwrite, So, it must be
"device": {
"id": "test",
"manufacturer": "test",
"model": "test',
"name": "test",
"adTrackingEnabled": true,
"advertisingId": "00000000-0000-0000-0000-000000000000",
"type": "ios"
},
btw , I mix it with facebook_app_event plugin to track default event such as App Install
Hey, I'm experiencing the same problem.
On Android, it all works as expected.
On iOS, the Application Installed
event is not being triggered. (I have set trackApplicationLifecycleEvents
totrue
)
The problem is probably in the way Segment is being configured:
If I configure Segment using Dart, by calling Segment.config(options: SegmentConfig(...
then the Application Installed
event will not get triggered.
But If I configure Segment the deprecated way, by modifying the Info.plist
then the Application Installed
event will get triggered as expected.
In the Segment documentation is says to configure Segment in the application:didFinishLaunchingWithOptions
, this is the case when configuring via the Info.plist
, but not when configuring with Dart.
@danielgomezrico @ariefwijaya I have a problem with advertisingId
and adTrackingEnabled
fields in Segment for release mode (Android). It doesn't appear :/
I get the advertisingId
from the advertising_id package.
@Mik77o for advertising id, this is how use it along flutter_segment.
you can use .setContext
method to put any key-value pair under spesific preserved key. it won't delete any other value except the one we want to overwrite,
...
In the Segment documentation is says to configure Segment in the
application:didFinishLaunchingWithOptions
, this is the case when configuring via theInfo.plist
, but not when configuring with Dart.
@danielgomezrico this happened to me, I found it never track Application Installed in iOS for our Dart-Installation. I've tried but now I have no idea to fix it,
We are facing the same issue... after upgrading the package to 3.9.0 and removing the Info.plist
keys not only we stopped getting Application Installed
events but we are also not getting as many Application Opened
events as we should.
We are getting Application Backgrounded
correctly though.
So most times we get 4/5 Application Backgrounded
events in a row from the same device, and not once we get Application Opened
By making the Dart config
call conditional to all but iOS
platform and adding back the Info.plist
keys, we started getting the correct events frequency on iOS
Unfortunately I'm not proficient enough in iOS dev to figure out where is the issue, so I cannot offer any more assistance - I only got to conclude that createConfigFromFile
and createConfigFromDict
methods in FlutterSegmentPlugin.m
look too similar to suspect an issue there 😅
@minoesteban I think that Application Updated event is also not tracked. (for iOS)
🤔 Its weird, I can see those events for iOS and android on our side, anyone has any clue?
@danielgomezrico
Can you confirm you are configuring Segment via Dart and not via Info.plist
.
Hey, I'm experiencing the same problem. On Android, it all works as expected. On iOS, the
Application Installed
event is not being triggered. (I have settrackApplicationLifecycleEvents
totrue
) The problem is probably in the way Segment is being configured:If I configure Segment using Dart, by calling
Segment.config(options: SegmentConfig(...
then theApplication Installed
event will not get triggered.But If I configure Segment the deprecated way, by modifying the
Info.plist
then theApplication Installed
event will get triggered as expected.In the Segment documentation is says to configure Segment in the
application:didFinishLaunchingWithOptions
, this is the case when configuring via theInfo.plist
, but not when configuring with Dart.
This looks like it is a method sequence issue with when the dart method Segment.config()
is called:
Method flow for App start with flutter-segment:
didFinishLaunchingWithOptions:
registerWithRegistry:
info.plist
setup is called via createConfigFromFile and eventually SEGAnalytics setupWithConfiguration SEE SEGAnalytics setupWithConfiguration method flow BELOWsuper didFinishLaunchingWithOptions:
For the dart Implementation calling Segment.config()
:
didFinishLaunchingWithOptions
is called sends the Application Installed eventSo if you call Segment.config()
after AppDelegate didFinishLaunchingWithOptions:
you will miss the first event. The setup instructions state that this needs to be done in a lifecycle event, e.g., didFinishLaunchingWithOptions
I wonder if there is away to call Segment.config()
in didFinishLaunchingWithOptions
?
I created a potential fix, #56, that manually sends the event Application Installed
and Application Updated
when we call the dart code Segment.config()
.
This is in the native iOS code of flutter_segement so will only run on iOS. It works in the same way that the native segment package works, analysis-ios, checks the same NSUserDefaults
, the implementation details of that method is here.
Tested and is sending the events now.
Maybe this can be closed @danielgomezrico ?
@Mik77o has updated to the latest version? This should be fixed after https://github.com/la-haus/flutter-segment/pull/56
@danielgomezrico Thanks for reminder. I will check it soon :)
@Mik77o any updates? 🤓
@danielgomezrico Seems to be working now! :)
You are welcome to reopen if it breaks again
I have noticed a problem with app installed event not being tracked for iOS. I am using version
3.7.0
. In the Segment configurationSegment.config
I havetrackApplicationLifecycleEvents set: true
, but this event does not seem to work.