segment-integrations / analytics-ios-integration-amplitude Goto Github PK
View Code? Open in Web Editor NEWThe Amplitude analytics-ios integration.
License: MIT License
The Amplitude analytics-ios integration.
License: MIT License
i tried adding this Segment-Amplitude as a dependency to my podfile, similarly to the Segment-Mixpanel and Segment-Branch integrations that we also use. However, it fails building, Segment-Amplitude, since it can't find a the Amplitude.h header. Is this a known issue?
FWIW, Adding Amplitude-iOS seperately from segment's wrapper pod works, but we don't get the segment benefits that way obviously.
Also, I was looking at the example project for any tips, but it doesn't seem to actually implement the Amplitude SDK, and is instead an empty integration.
My build details:
Swift 2.2 project with Xcode 7.3
platform: ios 9.0 only
use_frameworks! is enabled
There used to be a conflict what the recently introduced Gzip extension in analytics-ios
. That was just recently fixed. Could this library be updated to have as a dependency a version of analytics-iso
that has the namespaces GZIP extension?
Thanks!
I recently adding analytics-ios-integration-amplitude in order to get session logging but it appears to have introduced this issue of double counting users.
When my app is installed for the first time, Analytics just uses an anonymous id and logs the AppInstalled and AppOpened, etc. However, once I call SEGAnalytics.identify, instead of just updating the user_id of the current amplitude user, it makes a completely new one. This is breaking all my new user retention and user count metrics.
It appears that the device_id that Amplitude is different after the identify call, which is maybe why this issue is happening?
Users that logout and create another account are associated to the original user.
I'm currently performing the following:
Identify
when a user logs in and set a trait
for email
.Reset
when the user logs outIdentify
when new user logs in (or creates account) and set trait
for email
.The second user is associated with the first in amplitude and the email
trait is not set.
I'm trying to move my project away from Cocoapods, and almost all of my libraries have corresponding Swift Packages.
It would be great if this were available as a Swift Package so I could remove Cocoapods from my machine, and stop using it altogether.
Hi,
We are currently experiencing main thread API asserts for this integration that prevent us from running tests on our CI. It also throws these asserts while developing.
The issue begins in SEGAmplitudeIntegration
that calls [[Amplitude instance] initializeApiKey:apiKey];
This call should be called on a main queue OR prompt Amplitude to update their SDK to do this. I am linking Amplitude for this one.
It all boils down to how Amplitude uses UIApplication:
UIApplication *app = [self getSharedApplication];
if (app != nil) {
UIApplicationState state = app.applicationState;
if (state != UIApplicationStateBackground) {
// If this is called while the app is running in the background, for example
// via a push notification, don't call enterForeground
[self enterForeground];
}
}
So either Segment fixes this or Amplitude but it would be nice to see this resolved. Happy to submit a patch PR
I am trying to upgrade segment in my existing project
It works file till version 3.0.1 but after that, I always get this error
Include of non-modular header inside framework module 'Segment_Amplitude.SEGAmplitudeIntegration
I tried to de-integrate the pod, cleared derived data but still, the issue persists
Hi,
After few emails and tests with people from both Amplitude and Segment, we found out a strange behaviour in the last version of this SDK.
Basically, every time you try to override a user property that is already existing on the user by providing a new value. The old value is kept, and you cannot update it.
In order to reproduce the bug, just set up a new XCode project with the following pods:
pod 'Analytics', '~> 3.0'
pod 'Segment-Amplitude'
Then do an identify call with a trait (key: value
) followed by another identify call with the same key but another value (key: value2
).
Here is what the Segment's debugger shows, which is good so far:
then:
Normally, you should see the value2
appears under the key
user property under Amplitude's UI for the corresponding user.
By using the version 2.0.0 of this SDK, it doesn't work:
However, by downgrading to version 1.5.0 it worked, that's the fix I'm using right now.
pod 'Analytics', '~> 3.0'
pod 'Segment-Amplitude', '~> 1.5.0'
Attached, some screenshots to showcase the problem.
Thanks!
I updated the Segment-Amplitude pod to 1.4.3 in order to have the version 4.0 of the Amplitude-iOS pod.
In your Podspec the version of Amplitude-iOS seems to be set correctly, but when executing pod install
or pod update
the version which is installed is still the old 3.14...
In the Cocoapods specs repo, we see the version of Amplitude-iOS is still 3.14
At some point, things were working, so I'm not sure what changed recently. When adding this pod, I'm receiving the final error from cocoapods:
[!] The 'Pods-MOJO' target has transitive dependencies that include statically linked binaries: (Analytics)
This seems to relate to using use_frameworks!
in cocoapods. Removing that causes another error the #import <Segment/SEGAnalytics.h>
can't be found.
I recently upgraded to the latest segment-amplitude pod. Now im getting a 'Analytics/Analytics.h' file not found
error in the SegAmplitudeIntegration file, and Framework not found error in Xcode. No issue for the last year, and no issue with segment-mixpanel pod.
Hello,
By specifying the patch version in your Podfile dependencies, you're preventing library consumers from updating beyond the minor versions you specify here (docs).
analytics-ios-integration-amplitude/Segment-Amplitude.podspec
Lines 24 to 25 in 92ba4ff
These should just be ~> 3.7
and ~> 4.8
, respectively.
Hi folks,
I'm trying to create a user property that cannot be modified using the identify
API. I've configured this in the Segment console as described in the docs (I did hit Save! ๐):
I would have expected the integration to fork here
and work as described. However, in Amplitude's console I'm seeing the value of that user property change after multiple calls. ๐I'm guessing that the integration settings aren't getting updated appropriately. Any tips on troubleshooting this, or is there a way we can force the set-once behavior via the factory's configuration?
The XCFramework on the Releases page for version 3.3.0 contains slices for iOS and iOS simulator, but is missing slices for tvOS and tvOS simulator. I believe the RELEASING.md file should be updated to build frameworks for tvOS, and these should be included in the resulting XCFramework bundle.
Hello,
In my current iOS project, I've added the cocoapod Segment-Amplitude, last available version 3.2.0-alpha, with the cocoapod Analytics 3.0.6.
The compilation fails in AMPDatabaseHelper.m, with "use of undeclared identifier SQLITE_OPEN_READWRITE".
I'm still looking for way to fix that, but if anyone has an idea, I'm interested !
Thanks
l.
Amplitude-iOS 7.0.0 Release Notes
Summary: Amplitude removed a few things and now Segment-Amplitude is broken.
Background: Users reported that IDFA MACRO still do not prevent app rejections. So we make both idfa and location tracking to be fully customer driven.
Add
adSupportBlock
to let idfa tracking to be customer driven.
AddlocationInfoBlock
to let location tracking to be customer driven.
RemoveenableLocationListening
,disableLocationListening
andupdateLocation
APIs.
Hi,
I'm trying to add this Segment integration via Carthage but it fails with Task failed with exit code 65
.
Not sure if related but, I had to add it to the Cartfile using git "https://github.com/segment-integrations/analytics-ios-integration-amplitude.git"
as I couldn't find the name to install it via Carthage.
The log error file contains this:
** ARCHIVE FAILED **
The following build commands failed:
CompileC /Users/juangarcia/Library/Caches/org.carthage.CarthageKit/DerivedData/11.4.1_11E503a/analytics-ios-integration-amplitude/3.0.2/Build/Intermediates.noindex/ArchiveIntermediates/Segment-Amplitude/IntermediateBuildFilesPath/Segment-Amplitude.build/Release-iphoneos/Segment-Amplitude.build/Objects-normal/arm64/SEGAmplitudeIntegrationFactory.o /Users/juangarcia/Development/Name/Carthage/Checkouts/analytics-ios-integration-amplitude/Pod/Classes/SEGAmplitudeIntegrationFactory.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/juangarcia/Library/Caches/org.carthage.CarthageKit/DerivedData/11.4.1_11E503a/analytics-ios-integration-amplitude/3.0.2/Build/Intermediates.noindex/ArchiveIntermediates/Segment-Amplitude/IntermediateBuildFilesPath/Segment-Amplitude.build/Release-iphoneos/Segment-Amplitude.build/Objects-normal/armv7/SEGAmplitudeIntegration.o /Users/juangarcia/Development/Name/Carthage/Checkouts/analytics-ios-integration-amplitude/Pod/Classes/SEGAmplitudeIntegration.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/juangarcia/Library/Caches/org.carthage.CarthageKit/DerivedData/11.4.1_11E503a/analytics-ios-integration-amplitude/3.0.2/Build/Intermediates.noindex/ArchiveIntermediates/Segment-Amplitude/IntermediateBuildFilesPath/Segment-Amplitude.build/Release-iphoneos/Segment-Amplitude.build/Objects-normal/arm64/SEGAmplitudeIntegration.o /Users/juangarcia/Development/Name/Carthage/Checkouts/analytics-ios-integration-amplitude/Pod/Classes/SEGAmplitudeIntegration.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/juangarcia/Library/Caches/org.carthage.CarthageKit/DerivedData/11.4.1_11E503a/analytics-ios-integration-amplitude/3.0.2/Build/Intermediates.noindex/ArchiveIntermediates/Segment-Amplitude/IntermediateBuildFilesPath/Segment-Amplitude.build/Release-iphoneos/Segment-Amplitude.build/Objects-normal/armv7/SEGAmplitudeIntegrationFactory.o /Users/juangarcia/Development/Name/Carthage/Checkouts/analytics-ios-integration-amplitude/Pod/Classes/SEGAmplitudeIntegrationFactory.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(4 failures)
Thanks!
Even in a new project will fail while compiling.
My current Podfile for a test project is
target 'SegmentIntegrationTest' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Segment-Firebase', '~> 2.0'
# Pods for SegmentIntegrationTest
end
The error shows up in Firebase.h
with message 'FirebaseAnalytics/FirebaseAnalytics.h' file not found
Hi there! I'm trying to upgrade to the latest Amplitude and Segment-Amplitude, but the pin for Amplitude is set to '~> 7.0.1'
. This only allows for 7.0.1 or greater, up to not but including 7.1.0. I think you want something like '>= 7.0.1', '< 8.0'
(guessing). With the current setup though, it's not possible to update Segment-Amplitude and Amplitude to the latest versions, to date using CocoaPods.
Segment has renamed their module from Analytics
to Segment
which is breaking import statements in this project and does not compile. see: https://github.com/segmentio/analytics-ios/releases/tag/4.1.0
Hi @f2prateek
We're looking to pick up the latest changes and close #7 , but it looks like the spec repo thinks the latest version is 3.2.0-alpha.
when using pod 'Segment-Amplitude'
, a pod outdated
command reports the following
Segment-Amplitude 1.2.0 -> 1.2.0 (latest version 3.2.0-alpha)
can we expect this to be released soon? we'd obviously rather point to the common spec repo than master in this one.
Many SDKs are moving to Swift Package Manager support in addition to cocoapods.
It would be nice to get this repo via SPM as well.
When using traitsToIncrement
or traitsToSetOnce
, the traits that aren't incremental or set once don't override the current user properties in amplitude.
I've testing by calling [self.amplitude setUserProperties:payload.traits];
directly and the traits correctly update/override. However, when a incremental or setOnce trait is used (via Segment dashboard settings), this call isn't used an instead it calls:
- (void)incrementOrSetTraits:(NSDictionary *)traits
{
for (NSString *trait in traits) {
id value = [traits valueForKey:trait];
if ([self.traitsToIncrement member:trait]) {
[self.amplitude identify:[self.identify add:trait value:value]];
SEGLog(@"[Amplitude add:%@ value:%@]", trait, value);
} else if ([self.traitsToSetOnce member:trait]) {
[self.amplitude identify:[self.identify setOnce:trait value:value]];
} else {
[self.amplitude identify:[self.identify set:trait value:value]]; // don't override traits and is essentially a set once
SEGLog(@"[Amplitude set:%@ value:%@]", trait, value);
}
}
}
[self incrementOrSetTraits:payload.traits];
is called and the function will fail to override traits that already exist rather than calling [self.amplitude setUserProperties:payload.traits];
which appears to work as expected.
The error amplitude will log:
AMPLITUDE_LOG(@"Already used property '%@' in previous operation, ignoring for operation '%@'", property, operation);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.