Error Analysis
Prerequisites
Section titled PrerequisitesContentsquare SDK is included
Section titled Contentsquare SDK is includedYou must include the Contentsquare SDK first using the same integration method and understand how the SDK works.
Update to the latest SDK version
Section titled Update to the latest SDK versionIn order to enable Error Analysis in your app and get the most stable version, it is required to upgrade the SDK to its latest version.
Screen tracking implemented
Section titled Screen tracking implementedTracking will start at the 1st screenview event, it is required to have screen tracking implemented. Make sure to follow the iOS Track screens sections.
Reminder about User consent
Section titled Reminder about User consentIf you are in the process of implementing the SDK for the 1st time (or choose to take this update as an opportunity to review your Privacy related implementation), make sure to follow the iOS Privacy section and use the Opt-in API to get the user consent, otherwise no data will be collected.
Get Started
Section titled Get StartedAdd Contentsquare Error Analysis to your app
Section titled Add Contentsquare Error Analysis to your appHow to include it
Section titled How to include itYou should include the Contentsquare SDK first and use the same integration method.
Using Swift Package Manager
Section titled Using Swift Package Manager-
In Xcode, Same as Contentsquare SDK, Add the following link via
File > Add Packages…
: -
In your targets’ General settings tab, in the Frameworks, Libraries, and Embedded Content section, add
ContentsquareErrorAnalysisModule
.
Using Carthage
Section titled Using CarthageAdd the following line to your Cartfile:
Then run:
Drag and drop ContentsquareModuleErrorAnalysis.xcframework
from the Carthage/Build folder to your targets’ General settings tab, in the Frameworks, Libraries, and Embedded Content section.
Using CocoaPods
Section titled Using CocoaPodsOur SDK can be linked dynamically or statically:
Dynamic linking
Section titled Dynamic linkingDynamic linking is the default behavior with use_frameworks!
,
Add the following line to your Podfile:
Static linking
Section titled Static linkingIf you specify static linking in your Podfile with use_frameworks! :linkage => :static
,
Add the following line to your Podfile:
Manual Integration
Section titled Manual IntegrationOur SDK can be linked dynamically or statically:
Dynamic linking
Section titled Dynamic linkingGet the manual integration framework
Section titled Get the manual integration framework- Go to the iOS SDK GitHub repository ↗.
- Find the newest version available (unless instructed otherwise by your CS contact).
- Under
Assets
you should be able to findContentsquareErrorAnalysisModuleDynamicManually.xcframework.zip
, download the file.
Include the framework
Section titled Include the framework- Unzip
ContentsquareErrorAnalysisModuleDynamicManually.xcframework.zip
and you should seeContentsquareErrorAnalysisModule.xcframework
: - Copy
ContentsquareErrorAnalysisModule.xcframework
to any folder in your project. - In your
target
->General
->Frameworks, Libraries and Embedded Content
, addContentsquareErrorAnalysisModule.xcframework
by clicking ”+” -> “Add Other…” -> “Add Files…“. - Clean build folder and run.
Static linking
Section titled Static linkingGet the manual integration framework
Section titled Get the manual integration framework- Go to the iOS SDK GitHub repository ↗.
- Find the newest version available (unless instructed otherwise by your CS contact).
- Under
Assets
you should be able to findContentsquareErrorAnalysisModuleStaticManually.xcframework.zip
, download the file.
Include the framework
Section titled Include the framework- Unzip
ContentsquareErrorAnalysisModuleStaticManually.xcframework.zip
and you should seeContentsquareErrorAnalysisModule.xcframework
: - Copy
ContentsquareErrorAnalysisModule.xcframework
to any folder in your project. - In your
target
->General
->Frameworks, Libraries and Embedded Content
, addContentsquareErrorAnalysisModule.xcframework
by clicking ”+” -> “Add Other…” -> “Add Files…“. - Clean build folder and run.
Start the SDK
Section titled Start the SDKYou do not need to do anything to start the Error Analysis SDK, it will start itself with Contentsquare SDK.
Validate SDK integration
Section titled Validate SDK integrationWhen the SDK starts, you should see a log like this one:
Sample App
Section titled Sample AppFor best implementation practices of our library, explore the Contentsquare for iOS sample app ↗.
API Errors
Section titled API ErrorsAutomatic network inspection
Section titled Automatic network inspectionAPI Errors automatically collects failed network requests that use URLSession
.
Add custom monitoring for specific network requests
Section titled Add custom monitoring for specific network requestsThe API Errors automatically collects most network requests for your app. However, some requests might not be collected or you might use a different library to make network requests. In these cases, you can use the following API HTTPMetric
to manually collect data.
Debugging and Logging
Section titled Debugging and LoggingIf in-app features are enabled, a log should appear with the details of the event (see iOS Debugging and Logging section for more details).:
How API Errors works
Section titled How API Errors worksInitialization
Section titled InitializationThe way our SDK works is by auto-starting with the application launch and automatically collects failed network requests that use URLSession
.
Configuration
Section titled ConfigurationOnce started, our SDK fetches its config from our servers. It will start collecting data from network events if the API Errors setting is enabled in the config (this is handled by the Contentsquare team).
Tracking
Section titled TrackingThe SDK monitors only the API Errors with response code above 400, and generates analytics data. These events are then locally stored, and eventually sent to our servers in batches.
Sending data
Section titled Sending dataFor each network error, a new event will be sent in analytics and Session Replay data. Check the following sections to learn more about how data is processed and sent:
Collected data points
Section titled Collected data pointsOnly network calls with error (response code above 400) will be collected. Here is the list of data collected:
- URL (without query strings)
- HTTP method
- Response code
- Timestamp of the request
- Timestamp of the response
Known limitations and recommendations
Section titled Known limitations and recommendationsAutomatic collection limitations
Section titled Automatic collection limitationsThe auto collection doesn’t work for the following methods:
Workaround: For the async
methods, use the corresponding Contentsquare methods:
For other methods, use the custom monitoring APIs.
Conflict with Firebase Performance SDK on auto-collection
Section titled Conflict with Firebase Performance SDK on auto-collectionAPI Errors doesn’t compatible with Firebase Performance auto collection.
Workaround: Disable Firebase automatic monitoring:
It may also not compatible with other network auto collection.
Impact on Performance
Section titled Impact on PerformanceWe always strive to be non-intrusive, and transparent to the developers of the client app. We apply this rule on the performance as well. These are the technical specifics we can share on performance, if you have any questions feel free to reach out to us.
The following performance results were obtained under the following conditions:
Condition | Value |
---|---|
Device model | iPhone X 64GB |
iOS version | 16.1 |
Test App built using Xcode version | 13.4.1 |
Test App built with Swift version | 5.6.1 |
Property | Value |
---|---|
SDK size (installed size, no Bitcode) | 770 KB |
Max Ram usage | <4Mb |
Max SDK CPU peak on event | <1% |
Data transmitted over network for a default batch size of 50 events |