SlideShare a Scribd company logo
1 of 38
Download to read offline
Cómo tener analíticas en
tu app y no volverte loco
Gemma del Olmo
Quién soy
• Desarrollando iOS desde iOS 5

• iOS developer en ApeLucy: La app que te da
megas

• @gmmx919
Agenda
• El problema.

• La solución.

• Experiencia personal con diferentes herramientas
de Analytics.
EL PROBLEMA
Con algo de código y muchos gifs :)
El problema
• Necesitan integrar GoogleAnalytics
Vamos a ello
• pod ‘Google/Analytics’

• pod Install
AppDelegate
import Google
func application(application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [NSObject: AnyObject]?)
-> Bool {
..
self.setupGoogleAnalytics()
..
}
func setupGoogleAnalytics() {
// Configure tracker from GoogleService-Info.plist.
let configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: 
(configureError)")
let gai = GAI.sharedInstance()
gai.trackUncaughtExceptions = true // report uncaught exceptions
gai.logger.logLevel = GAILogLevel.Verbose // remove before app release
}
Enviar eventos
@IBAction func login(sender: AnyObject) {
var tracker = GAI.sharedInstance().defaultTracker
tracker.send(GAIDictionaryBuilder.createEventWithCategory("Button",
action: "Login", label: nil, value: nil).build() as [NSObject :
AnyObject])
}
El problema
• Necesitan integrar GoogleAnalytics

• 1 semana más tarde…
El problema
• Necesitan integrar GoogleAnalytics

• 1 semana más tarde… Necesitan integrar eventos de
Fabric
Vamos a ello
• pod ‘Fabric’

• pod ‘Answers’

• pod Install
AppDelegate
import Google
import Fabric
import Answers
func application(application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [NSObject: AnyObject]?)
-> Bool {
..
setupGoogleAnalytics()
setupFabricAnalytics()
..
}
func setupGoogleAnalytics() {
// Configure tracker from GoogleService-Info.plist.
let configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: 
(configureError)")
let gai = GAI.sharedInstance()
gai.trackUncaughtExceptions = true // report uncaught exceptions
gai.logger.logLevel = GAILogLevel.Verbose // remove before app release
}
func setupFabricAnalytics() {
Fabric.with([Answers.self])
}
Enviar eventos
@IBAction func login(sender: AnyObject) {
var tracker = GAI.sharedInstance().defaultTracker
tracker.send(GAIDictionaryBuilder.createEventWithCategory("Button",
action: "Login", label: nil, value: nil).build() as [NSObject : AnyObject])
Answers.logCustomEvent(withName: "Login", customAttributes: nil)
}
El problema
• Necesitan integrar GoogleAnalytics

• 1 semana más tarde… Necesitan integrar eventos de
Fabric

• 1 mes más tarde…
El problema
• Necesitan integrar GoogleAnalytics

• 1 semana más tarde… Necesitan integrar eventos de
Fabric

• 1 mes más tarde… Quieren integrar Amplitude
LA SOLUCIÓN
Partes en común de
los SDK de analytics
• Inicializar en
applicationDidFinishLaunchingWithOp
tions

• Enviar eventos en el controller
AnalyticsService
protocol AnalyticsService {
func initialize(application: UIApplication, launchOptions:
[UIApplicationLaunchOptionsKey: Any]?)
func track(event: AnalyticsEvent)
}
Qué es un evento
enum AnalyticsEvent {
case login
case levelUp(level: Int)
case signUp
case updateProfile
}
Qué es un evento
extension AnalyticsEvent {
var name: String {
switch self {
case .login:
return "Login"
case .levelUp(_):
return "Level Up"
case .signUp:
return "Signup"
case .updateProfile:
return "Update Profile"
}
}
var metadata: [String: String] {
switch self {
case .levelUp(let level):
return ["level": String(level)]
default:
return [:]
}
}
}
AnalyticsService - Fabric
class FabricAnalyticsService: AnalyticsService {
func initialize(application: UIApplication, launchOptions:
[UIApplicationLaunchOptionsKey : Any]?) {
Fabric.with([Crashlytics.self])
}
func track(event: AnalyticsEvent) {
Answers.logCustomEvent(withName: event.name, customAttributes:
event.metadata)
}
}
Lo que nuestros
controllers conocerán
• Eventos

• AnalyticsManager
AnalyticsManager
class AnalyticsManager: AnalyticsService {
private var services: [AnalyticsService] = [FabricAnalyticsService(),
AmplitudeAnalyticsService()]
static let instance = AnalyticsManager()
private init() {}
func initialize(application: UIApplication, launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) {
for service in services {
service.initialize(
application : application,
launchOptions : launchOptions
)
}
}
func track(event: AnalyticsEvent) {
for service in services {
service.track(event: event)
}
}
}
Let’s go!
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
AnalyticsManager.instance.initialize(application: application,
launchOptions: launchOptions)
return true
}
Trackear eventos
@IBAction func loginTapped() {
analyticsManager.track(event: .login)
}
func userDidLevelUp() {
analyticsManager.track(event: .levelUp(level: 5))
}
Cómo encajo esto en
una arquitectura
class ViewControllerTracker {
let analytics: AnalyticsService
init(analyticsService: AnalyticsService = AnalyticsManager.instance) {
analytics = analyticsService
}
func userDidLogin() {
analytics.track(event: .login)
}
func userDidLevelUp(level: Int) {
analytics.track(event: .levelUp(level: level))
}
}
Trackear eventos
class ViewController: UIViewController {
let tracker: ViewControllerTracker = ViewControllerTracker()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
//MARK: - IBActions
@IBAction func loginTapped() {
tracker.userDidLogin()
}
@IBAction func levelUpTapped() {
tracker.userDidLevelUp(level: 5)
}
}
EXTRA: Qué herramienta de
analytics uso actualmente y por
qué
• Google Analytics

• Fabric

• Firebase

• Amplitude
PREGUNTAS
One more thing…
One more thing…
50 MB Gratis
Usando el código
NSCoders
Descarga ApeLucy
¡GRACIAS!
😘 😘 😘

More Related Content

What's hot

Introducing Vuex in your project
Introducing Vuex in your projectIntroducing Vuex in your project
Introducing Vuex in your projectDenny Biasiolli
 
Lessons Learned Implementing a GraphQL API
Lessons Learned Implementing a GraphQL APILessons Learned Implementing a GraphQL API
Lessons Learned Implementing a GraphQL APIDirk-Jan Rutten
 
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)DicodingEvent
 
Introduction to ReactJS and Redux
Introduction to ReactJS and ReduxIntroduction to ReactJS and Redux
Introduction to ReactJS and ReduxBoris Dinkevich
 
Angular 4 with firebase
Angular 4 with firebaseAngular 4 with firebase
Angular 4 with firebaseAnne Bougie
 
Crossing platforms with JavaScript & React
Crossing platforms with JavaScript & React Crossing platforms with JavaScript & React
Crossing platforms with JavaScript & React Robert DeLuca
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesDavid Wengier
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeedYonatan Levin
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019David Wengier
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sRoel Hartman
 

What's hot (20)

Firebase ng2 zurich
Firebase ng2 zurichFirebase ng2 zurich
Firebase ng2 zurich
 
Introducing Vuex in your project
Introducing Vuex in your projectIntroducing Vuex in your project
Introducing Vuex in your project
 
Lessons Learned Implementing a GraphQL API
Lessons Learned Implementing a GraphQL APILessons Learned Implementing a GraphQL API
Lessons Learned Implementing a GraphQL API
 
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
 
Introduction to ReactJS and Redux
Introduction to ReactJS and ReduxIntroduction to ReactJS and Redux
Introduction to ReactJS and Redux
 
Angular 4 with firebase
Angular 4 with firebaseAngular 4 with firebase
Angular 4 with firebase
 
Crossing platforms with JavaScript & React
Crossing platforms with JavaScript & React Crossing platforms with JavaScript & React
Crossing platforms with JavaScript & React
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Angular mix chrisnoring
Angular mix chrisnoringAngular mix chrisnoring
Angular mix chrisnoring
 
A (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project FilesA (very) opinionated guide to MSBuild and Project Files
A (very) opinionated guide to MSBuild and Project Files
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeed
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
 
Ngrx
NgrxNgrx
Ngrx
 
Advanced redux
Advanced reduxAdvanced redux
Advanced redux
 
Testing AngularJS
Testing AngularJSTesting AngularJS
Testing AngularJS
 
Reduxing like a pro
Reduxing like a proReduxing like a pro
Reduxing like a pro
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-redux
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
 

Similar to Cómo tener analíticas en tu app y no volverte loco

Knowing is Understanding: A road trip through Google analytics for Windows Ph...
Knowing is Understanding: A road trip through Google analytics for Windows Ph...Knowing is Understanding: A road trip through Google analytics for Windows Ph...
Knowing is Understanding: A road trip through Google analytics for Windows Ph...blugri software + services BVBA
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinRapidValue
 
Google Play Services Rock
Google Play Services RockGoogle Play Services Rock
Google Play Services RockPeter Friese
 
Google Analytics intro - Best practices for WCM
Google Analytics intro - Best practices for WCMGoogle Analytics intro - Best practices for WCM
Google Analytics intro - Best practices for WCMAmplexor
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsLoiane Groner
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Opticon 2015 - Getting Started with the Optimizely Developer Platform
Opticon 2015 - Getting Started with the Optimizely Developer PlatformOpticon 2015 - Getting Started with the Optimizely Developer Platform
Opticon 2015 - Getting Started with the Optimizely Developer PlatformOptimizely
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxNgLQun
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espressoÉdipo Souza
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsSami Ekblad
 
AI: Integrate Search Function into Your App Using Bing Search API.
AI: Integrate Search Function into Your App Using Bing Search API.AI: Integrate Search Function into Your App Using Bing Search API.
AI: Integrate Search Function into Your App Using Bing Search API.Marvin Heng
 
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Frédéric Harper
 
Google analytics
Google analyticsGoogle analytics
Google analyticsSean Tsai
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for DevelopersRubén Martínez
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for DevelopersParadigma Digital
 
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22Frédéric Harper
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 

Similar to Cómo tener analíticas en tu app y no volverte loco (20)

Knowing is Understanding: A road trip through Google analytics for Windows Ph...
Knowing is Understanding: A road trip through Google analytics for Windows Ph...Knowing is Understanding: A road trip through Google analytics for Windows Ph...
Knowing is Understanding: A road trip through Google analytics for Windows Ph...
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
 
Google Play Services Rock
Google Play Services RockGoogle Play Services Rock
Google Play Services Rock
 
Google Analytics intro - Best practices for WCM
Google Analytics intro - Best practices for WCMGoogle Analytics intro - Best practices for WCM
Google Analytics intro - Best practices for WCM
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Opticon 2015 - Getting Started with the Optimizely Developer Platform
Opticon 2015 - Getting Started with the Optimizely Developer PlatformOpticon 2015 - Getting Started with the Optimizely Developer Platform
Opticon 2015 - Getting Started with the Optimizely Developer Platform
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
 
AI: Integrate Search Function into Your App Using Bing Search API.
AI: Integrate Search Function into Your App Using Bing Search API.AI: Integrate Search Function into Your App Using Bing Search API.
AI: Integrate Search Function into Your App Using Bing Search API.
 
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
 
Google analytics
Google analyticsGoogle analytics
Google analytics
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for Developers
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for Developers
 
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
HTML for the Mobile Web, Firefox OS - All Things Open - 2014-10-22
 
mobl
moblmobl
mobl
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 

Recently uploaded

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 

Recently uploaded (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 

Cómo tener analíticas en tu app y no volverte loco

  • 1. Cómo tener analíticas en tu app y no volverte loco Gemma del Olmo
  • 2. Quién soy • Desarrollando iOS desde iOS 5 • iOS developer en ApeLucy: La app que te da megas • @gmmx919
  • 3. Agenda • El problema. • La solución. • Experiencia personal con diferentes herramientas de Analytics.
  • 4. EL PROBLEMA Con algo de código y muchos gifs :)
  • 5. El problema • Necesitan integrar GoogleAnalytics
  • 6.
  • 7. Vamos a ello • pod ‘Google/Analytics’ • pod Install
  • 8. AppDelegate import Google func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { .. self.setupGoogleAnalytics() .. } func setupGoogleAnalytics() { // Configure tracker from GoogleService-Info.plist. let configureError:NSError? GGLContext.sharedInstance().configureWithError(&configureError) assert(configureError == nil, "Error configuring Google services: (configureError)") let gai = GAI.sharedInstance() gai.trackUncaughtExceptions = true // report uncaught exceptions gai.logger.logLevel = GAILogLevel.Verbose // remove before app release }
  • 9. Enviar eventos @IBAction func login(sender: AnyObject) { var tracker = GAI.sharedInstance().defaultTracker tracker.send(GAIDictionaryBuilder.createEventWithCategory("Button", action: "Login", label: nil, value: nil).build() as [NSObject : AnyObject]) }
  • 10.
  • 11. El problema • Necesitan integrar GoogleAnalytics • 1 semana más tarde…
  • 12. El problema • Necesitan integrar GoogleAnalytics • 1 semana más tarde… Necesitan integrar eventos de Fabric
  • 13.
  • 14. Vamos a ello • pod ‘Fabric’ • pod ‘Answers’ • pod Install
  • 15. AppDelegate import Google import Fabric import Answers func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { .. setupGoogleAnalytics() setupFabricAnalytics() .. } func setupGoogleAnalytics() { // Configure tracker from GoogleService-Info.plist. let configureError:NSError? GGLContext.sharedInstance().configureWithError(&configureError) assert(configureError == nil, "Error configuring Google services: (configureError)") let gai = GAI.sharedInstance() gai.trackUncaughtExceptions = true // report uncaught exceptions gai.logger.logLevel = GAILogLevel.Verbose // remove before app release } func setupFabricAnalytics() { Fabric.with([Answers.self]) }
  • 16. Enviar eventos @IBAction func login(sender: AnyObject) { var tracker = GAI.sharedInstance().defaultTracker tracker.send(GAIDictionaryBuilder.createEventWithCategory("Button", action: "Login", label: nil, value: nil).build() as [NSObject : AnyObject]) Answers.logCustomEvent(withName: "Login", customAttributes: nil) }
  • 17.
  • 18. El problema • Necesitan integrar GoogleAnalytics • 1 semana más tarde… Necesitan integrar eventos de Fabric • 1 mes más tarde…
  • 19. El problema • Necesitan integrar GoogleAnalytics • 1 semana más tarde… Necesitan integrar eventos de Fabric • 1 mes más tarde… Quieren integrar Amplitude
  • 20.
  • 22. Partes en común de los SDK de analytics • Inicializar en applicationDidFinishLaunchingWithOp tions • Enviar eventos en el controller
  • 23. AnalyticsService protocol AnalyticsService { func initialize(application: UIApplication, launchOptions: [UIApplicationLaunchOptionsKey: Any]?) func track(event: AnalyticsEvent) }
  • 24. Qué es un evento enum AnalyticsEvent { case login case levelUp(level: Int) case signUp case updateProfile }
  • 25. Qué es un evento extension AnalyticsEvent { var name: String { switch self { case .login: return "Login" case .levelUp(_): return "Level Up" case .signUp: return "Signup" case .updateProfile: return "Update Profile" } } var metadata: [String: String] { switch self { case .levelUp(let level): return ["level": String(level)] default: return [:] } } }
  • 26. AnalyticsService - Fabric class FabricAnalyticsService: AnalyticsService { func initialize(application: UIApplication, launchOptions: [UIApplicationLaunchOptionsKey : Any]?) { Fabric.with([Crashlytics.self]) } func track(event: AnalyticsEvent) { Answers.logCustomEvent(withName: event.name, customAttributes: event.metadata) } }
  • 27. Lo que nuestros controllers conocerán • Eventos • AnalyticsManager
  • 28. AnalyticsManager class AnalyticsManager: AnalyticsService { private var services: [AnalyticsService] = [FabricAnalyticsService(), AmplitudeAnalyticsService()] static let instance = AnalyticsManager() private init() {} func initialize(application: UIApplication, launchOptions: [UIApplicationLaunchOptionsKey: Any]?) { for service in services { service.initialize( application : application, launchOptions : launchOptions ) } } func track(event: AnalyticsEvent) { for service in services { service.track(event: event) } } }
  • 29. Let’s go! func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { AnalyticsManager.instance.initialize(application: application, launchOptions: launchOptions) return true }
  • 30. Trackear eventos @IBAction func loginTapped() { analyticsManager.track(event: .login) } func userDidLevelUp() { analyticsManager.track(event: .levelUp(level: 5)) }
  • 31. Cómo encajo esto en una arquitectura class ViewControllerTracker { let analytics: AnalyticsService init(analyticsService: AnalyticsService = AnalyticsManager.instance) { analytics = analyticsService } func userDidLogin() { analytics.track(event: .login) } func userDidLevelUp(level: Int) { analytics.track(event: .levelUp(level: level)) } }
  • 32. Trackear eventos class ViewController: UIViewController { let tracker: ViewControllerTracker = ViewControllerTracker() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } //MARK: - IBActions @IBAction func loginTapped() { tracker.userDidLogin() } @IBAction func levelUpTapped() { tracker.userDidLevelUp(level: 5) } }
  • 33. EXTRA: Qué herramienta de analytics uso actualmente y por qué • Google Analytics • Fabric • Firebase • Amplitude
  • 35.
  • 37. One more thing… 50 MB Gratis Usando el código NSCoders Descarga ApeLucy