{"id":15038641,"url":"https://github.com/vectorform/symbiote","last_synced_at":"2026-03-03T03:06:04.540Z","repository":{"id":56922437,"uuid":"55700752","full_name":"vectorform/Symbiote","owner":"vectorform","description":"Symbiote is an analytics framework that supports multiple platforms, auto enables basic analytics in your app and is easily extensible with event processors.","archived":false,"fork":false,"pushed_at":"2017-02-15T16:17:07.000Z","size":40,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-04-24T18:53:19.250Z","etag":null,"topics":["analytics","analytics-events","analytics-framework","auto-analytics","cocoapods","event-processor","ios","ios-swift","swift3"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vectorform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-07T14:21:39.000Z","updated_at":"2017-10-17T17:02:27.000Z","dependencies_parsed_at":"2022-08-20T22:20:21.833Z","dependency_job_id":null,"html_url":"https://github.com/vectorform/Symbiote","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FSymbiote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FSymbiote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FSymbiote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorform%2FSymbiote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vectorform","download_url":"https://codeload.github.com/vectorform/Symbiote/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254256659,"owners_count":22040329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","analytics-events","analytics-framework","auto-analytics","cocoapods","event-processor","ios","ios-swift","swift3"],"created_at":"2024-09-24T20:39:23.704Z","updated_at":"2026-03-03T03:06:04.500Z","avatar_url":"https://github.com/vectorform.png","language":"Swift","readme":"# Symbiote\nCreated and maintained by Vectorform.\n\n[![Version](https://img.shields.io/cocoapods/v/Symbiote.svg?style=flat)](http://cocoapods.org/pods/Symbiote)\n[![License](https://img.shields.io/cocoapods/l/Symbiote.svg?style=flat)](http://cocoapods.org/pods/Symbiote)\n[![Platform](https://img.shields.io/cocoapods/p/Symbiote.svg?style=flat)](http://cocoapods.org/pods/Symbiote)\n\n## About\nSymbiote is an analytics framework that supports multiple platforms, auto enables basic analytics in your app and is easily extensible with event processors.\nExtended analytics support can be enabled by subclassing UIButtons and UIViewControllers from analytics subclasses and providing a view name. This will enable the framework to automatically build view paths and label buttons with their respective actions correctly.\nUnsupported analytics platforms may be integrated by implementing a simple event logging protocol. Custom events can be created easily.\nEvents may be filtered and processed (add/edit/remove/analyze data) by adding custom event processors which are filtered by EventFilters to the event bus.\n\n### Currently Supported Platforms\n  * Amazon Mobile Analytics\n  * Flurry\n  * Simple Logging *(Debug only!)*\n\n## Installing\n\n### Cocoapods\n\nYou can install this library using [Cocoapods](https://cocoapods.org/pods/TODO). You can get started with Cocoapods by [following their install guide](https://guides.cocoapods.org/using/getting-started.html#getting-started), and learn how to use Cocoapods to install dependencies [by following this guide](https://guides.cocoapods.org/using/using-cocoapods.html).\n\nIn your podfile, you want to add `pod 'Symbiote', '0.3.0'` (Swift 3). Then run `pod install` inside your terminal. With Cocoapods, we support iOS: 9.0 and above.\n\n#### Swift 2\n\nFor Swift 2 support, you must use version 0.1.2.\n\n\n### Reference Documentation\n\nYou can find the latest reference documentation on [Cocoadocs](http://cocoadocs.org/docsets/Symbiote). Install this documentation to [Dash](http://kapeli.com/dash) or Xcode using [Docs for Xcode](https://documancer.com/xcode/). On the [docs page](http://cocoadocs.org/docsets/Symbiote), click the 'share' button in the upper right.\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\n## Author\n\nJohannes Start, jstart@vectorform.de\n\n### Contributors\n\nAaron DeGrow, adegrow@vectorform.com\n\n## License\n\nSymbiote is available under the BSD license. See the [LICENSE](LICENSE) file for more info.\n\n## Getting Help\n\nIf you see a bug, feel free to post an issue. Please see the [contribution guidelines](https://github.com/vectorform/symbiote/blob/master/.github/CONTRIBUTING.md) before proceeding.\n\n\n## Getting Started\n\n### Basic Auto Analytics\nTo get started with Symbtiote and simple auto analytics integration you will need to add **pod 'Symbiote'** to your podfile. After running **pod install** you will be able to use it in your project. Auto analytics use swizzling to integrate into all UIViewControllers and UIEvents to determine when views show, disappear or buttons are pressed.\nIn your AppDelegate's init you have to import Symbiote and enable a log provider:\n```swift\nimport UIKit\nimport Symbiote\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    var window: UIWindow?\n    \n    override init() {\n        super.init()\n\n        // Enable simple log provider to print all output.\n        // TODO: Disable for production build!\n        Symbiote.SharedInstance.register(analyticsProvider: DebugLogProvider());\n    }\n\n}\n```\n\n### Analytics Provider\nThe default Provider (**DebugLogProvider**) will simply print your analytics events for debug purposes. Don't use this provider in production.\nTo enable one of the supported analytics providers add the relevant subspec to your podfile: `pod 'Symbiote/Provider/AWSAnalytics'`\nFollowing subspecs are currently available:\n```ruby\npod 'Symbiote/Provider/DebugLog' # Included by default.\npod 'Symbiote/Provider/AWSMobileAnalytics'\npod 'Symbiote/Provider/FlurryAnalytics'\n```\n\n### Advanced Auto Analytics (Base Classes)\nTo enable advanced automatic analytics you'll need to use the provided base classes for all **UIViewControllers**, **UINavigationControllers** and **UIButtons** or implement the **AnalyticsCompatible** protocol. This will enable Symbiote to automatically create view paths and hierarchies and log them accordingly.\n\n#### UIViewControllers\n```swift\nimport UIKit\nimport Symbiote\n\nclass SampleViewController: AnalyticsEnabledViewController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        analyticsDescription = \"SampleViewController\"\n    }\n\n}\n```\n#### Using Analytics Enabled UINavigationControllers\n```swift\nimport UIKit\nimport Symbiote\n\nclass SampleNavigationController: AnalyticsEnabledNavigationController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        analyticsDescription = \"SampleNavigationController\"\n        // Optionally set parentViewController\n        parentViewController = aViewController\n    }\n\n}\n```\n#### Using Analytics Enabled UIButtons\n```swift\nlet sampleEventButton:AnalyticsEnabledButton = AnalyticsEnabledButton(frame: CGRectMake(100, 200, 100, 50))\nsampleEventButton.setTitle(\"Sample Button Event\", forState: UIControlState.Normal)\nsampleEventButton.parentViewController = self\nsampleEventButton.analyticsDescription = \"SampleEventButton\"\n```\nFor more flexibility AnalyticsEnabledButton may also be subclassed.\nUIButtons can use a custom analytics events for UIControlEvents.TouchUpInside:\n```swift\nsampleEventButton.customEvent = Event(sender: AnalyticsExtensions.SampleSender, action: AnalyticsExtensions.SampleAction)\n```\n\n### Events\nEvents may be created and logged by using the **Event** class. Symbiote comes packaged with a few integrated event properties. In most cases it will make sense to create custom event Methods, senders and events since the default ones are limited to basic iOS functionality.\n\n#### Methods\nMethods define how the event was logged. This may be via *Swizzling*, a *DirectCall* or *AppDelegateCall*. When creating and sending a custom event the event Method should be **Event.Methods.DirectCall** - this is the default.\nIntegrated Methods:\n\n   * Event.Methods.Generic\n   * Event.Methods.SwizzleHook\n   * Event.Methods.SubclassHook\n   * Event.Methods.AppDelegateCall\n   * Event.Methods.DirectCall\n\nCustom Methods may be defined by creating a new Event.Method:\n```swift\nlet AnalyticsMethodBluetoothDeviceBridge = Event.Method(\"BluetoothDeviceBridge\")\n```\n\n#### Senders\nSenders represent the class of an object that sends an event. Senders include the *AppDelegate (App)*, a *UIViewController (View)* or a *UIButton (Button)*.\nIntegrated Senders:\n\n  * Event.Senders.Generic\n  * Event.Senders.Button\n  * Event.Senders.View\n  * Event.Senders.App\n\nSenders are created by creating a new Event.Sender:\n```swift\nlet AnalyticsSenderMap = Event.Sender(\"Map\") // Map components that log/send events\n```\n\n#### Actions\nActions define what action was applied to the sender. A *Button* may be **Pressed** and a *View* may **Appear**.\nIntegrated Actions:\n  * Event.Actions.Generic\n  * Event.Actions.Press\n  * Event.Actions.Appear\n  * Event.Actions.Disappear\n  * Event.Actions.Start\n  * Event.Actions.Foreground\n  * Event.Actions.Background\n  * Event.Actions.Active\n  * Event.Actions.Resign\n  * Event.Actions.Terminate\n\nA custom action for a *AnalyticsSenderMap* could be the successful location of a user: **Located**.\nActions are defined by creating an Event.Action:\n```swift\nlet AnalyticsActionLocated = Event.Action(\"Located\")\n```\n\n#### Data \u0026 DataDescriptors\nEvents can hold additional data to keep track of important metrics. When a *View* disappears it's helpful to know how long it was on screen, so the data dictionary of the event could have a key containing this metric. To simplify and standardize these keys Symbiote uses data descriptors. When adding a custom metric to the data dictionary a default DataDescriptor must be used or a custom one must be created.\nIntegrated DataDescriptors:\n  * Event.DataDescriptors.ViewName\n  * Event.DataDescriptors.SelectorName\n  * Event.DataDescriptors.Path\n\nTo create a custom DataDescriptor create an Event.DataDescriptor:\n```swift\nlet AnalyticsDataDescriptorsLocationAccuracy = Event.DataDescriptor(\"LocationAccuracy\")\n```\n\n#### Custom Logging Events\n\nEvent with default parameters:\n```swift\nSymbiote.SharedInstance.log(event: Event(method: Event.Methods.AppDelegateCall, sender: Event.Senders.App, action: Event.Actions.Start, data: [:]))\n```\nEvent with custom parameters:\n```swift\nlet locationAccuracy = \"10m\"\nSymbiote.SharedInstance.log(event: Event(sender: AnalyticsSenderMap, action: AnalyticsActionLocated, data: [ AnalyticsDataDescriptorsLocationAccuracy: locationAccuracy ]))\n```\n\n### Event Processors \u0026 Filters\nEvent processors add/edit/remove data from an analytics event or prohibit logging. They are executed right before logging in the order they are added. When adding an event processor a filter must be set to define on what type of event the specific processor may be executed. To enable a processor for all Events use a filter like **AllowAllFilter**.\nThis is how you register an event processor with a filter:\n```swift\n// Sample of how to prohibit all events with a .App sender\nSymbiote.SharedInstance.register(eventProcessor: ProhibitAllProcessor(), filter: SimpleGenericFilter(filterSenders: [Event.Senders.App]))\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorform%2Fsymbiote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvectorform%2Fsymbiote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorform%2Fsymbiote/lists"}