Code Monkey home page Code Monkey logo

snowplow-ios-tracker's Introduction

iOS, macOS, tvOS and watchOS Analytics for Snowplow

actively-maintained Build Status Coverage Status Platform Version Carthage License

snowplow-logo

Snowplow is a scalable open-source platform for rich, high quality, low-latency data collection. It is designed to collect high quality, complete behavioral data for enterprise business.

To find out more, please check out the Snowplow website and our documentation.

Snowplow iOS Tracker Overview

The Snowplow iOS Tracker allows you to add analytics to your mobile apps when using a Snowplow pipeline.

With this tracker you can collect event data from your applications, games or frameworks.

Technical documentation can be found for each tracker in our Documentation.

Demo apps using the Snowplow iOS Tracker

Some examples of demo apps instrumented with our iOS Tracker can be found in the snowplow-ios-tracker-examples repository.

Instrument the iOS Tracker

Technical Docs Setup Guide API Docs
i1 i2 i3
Technical Docs Setup Guide API Docs

Maintainers

Contributing
i4
Contributing

Copyright and license

The Snowplow iOS/macOS/tvOS/watchOS Tracker is copyright 2013-present Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

snowplow-ios-tracker's People

Contributors

alexanderdean avatar alexbenny avatar chrisfsampaio avatar darthmike avatar duncan avatar ejensen avatar hlian avatar i-dama avatar jbeemster avatar jonalmeida avatar jrmsklar avatar juraldinio avatar knservis avatar kymer avatar leonardors avatar loufranco avatar lunij avatar mattrobmattrob avatar matus-tomlein avatar mhadam avatar miike avatar mscwilson avatar mylifeasdog avatar nvelichkin avatar oguzhanunlu avatar paulboocock avatar sduperron-viadeo avatar sgleadow avatar swilliams-intellum avatar thomas-brx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snowplow-ios-tracker's Issues

Add dvce_sent_timestamp to querystring

This is an idea to make timestamps more accurate.

The problem on mobile:

  1. Device clocks and thus dvce_timestamp can be unreliable
  2. collector timestamp can be out by days (due to delayed send)

The proposed solution:

  1. When we send an event, we record the delta in ms between a) when the event was generated on the device and b) when it was sent. This delta is calculated using exclusively the device clock. If an event fails to send, then obviously the delta is recalculated for the next send
  2. When we process an event in the Enrichment, we create a new timestamp, collector_tstamp_adjusted, which is the collector_tstamp minus the delta recorded in 1

So we end up with a new timestamp which is anchored by the collector_tstamp, but is adjusted to take account of delayed send.

This is only useful/important for trackers which have a lot of delayed send.

/cc @yalisassoon, @jonalmeida for thoughts. Unscheduled

Build tracker to be iOS 6.1 compatible

It's not easily possible to build against the iOS 6.1 SDK with XCode 5 (Apple enforces you to build for 7+), so a workaround like this would be needed.

Note: Currently building against 7.1

Add in-client sessionization

It would be nice to create a way of doing client-side sessionization, somewhat similar to how the JavaScript Tracker does it:

The JavaScript Tracker sets a first-party cookie to track the Snowplow session. This
cookie is kept up to date with the latest activity. When there is a gap (of 30 minutes) in
activity, then the session index is incremented. This is sent through as vid here:

https://github.com/snowplow/snowplow/wiki/snowplow-tracker-protocol#15-user-related-parameters

It would be nice to do something equivalent for mobile. A few questions:

  1. How should we define the end of a session? Inactivity? Backgrounding? Something else?
  2. Should we make session definition customizable, or is that a world of pain?
  3. Where should this live? Do we overload the vid field or add this to the mobile context? Overloading vid feels a little messy but semantically this is the exact same data: the session index for a given client platform

/cc @yalisassoon @azsmith

Consider refactoring how we set mobile context

When we have a determined/unchanging schema for how the context 'co' is going to be set, we should consider refactoring our 0.1 implementation to be configurable or generic. Right now, it feels a bit hard coded and ugly to read.

Early thoughts:

  • SnowplowPayload should be an object which always has schema with data configurable as an array or object.
    • This would let us have nested payloads (see example payload below)
  • Fix inheritance from NSDictionary
  • Add inits with default schema
  • Solve how to make data optionally a dictionary or array ( EDIT: Use type id and check with [myObject isKindOfClass:[NSDictionary class]] )
{
    schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-0',
    data: [{
        eid: 'BBBAEB98-B556-43E6-8A07-80B6FD093C2E',
        vp: '320x480',
        p: 'mob',
        co: {
            schema: 'iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0',
            data: [{
                schema: 'iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-0',
                data: {
                    osType: '...',
                    osVersion: '...',
                    deviceVendor: '...',
                    deviceModel: '...',
                    carrier: '...'
                }
            }]
        },
        refr: 'myreferrer',
        url: 'http://foo.com',
        dtm: 1402062281979.792,
        tv: 'ios-0.1',
        tna: 'myname',
        lang: 'en',
        page: 'This is my foo',
        e: 'pv',
        aid: 'foo',
        res: '320x480'
    }]
}

Replace any iglu:// with iglu:

[13:56] Alex Dean: Hey @Fred
        What do you think of removing the // from the start of the Iglu path
        iglu:com.channel2.vod/video_played/jsonschema/1-0-0
        two reasons
        1. it's extraneous
        2. :\/ suggests some kind of uri is following
        : / / ^^
        when it's not
        I'm thinking of mailto:blah@http://blah.com
[13:58] Fred Blundun: Those are good points
[13:59] Alex Dean: seeing :\/ then a back-to-front domain is a bit confusing I think
        gah : / /
[14:00] Fred Blundun: Isn't http://snowplow.website.com/contexts/jsonschema/1-0-0 a sort of URI?
[14:00] Alex Dean: com.snowplow.website?
[14:00] Fred Blundun: That's what I should have typed
[14:01] Alex Dean: http://en.wikipedia.org/wiki/Uniform_resource_identifier
        The URI syntax consists of a URI scheme name (such as "http", "ftp", "mailto", "crid" or "file") followed by a colon character, and then by a scheme-specific part.
[14:02] Fred Blundun: I suppose iglu is fundamentally pretty different from http or https
[14:03] Alex Dean: http://www.ietf.org/rfc/rfc1738.txt
[14:03] Alex Dean: 
        3.1. Common Internet Scheme Syntax

  While the syntax for the rest of the URL may vary depending on the
  particular scheme selected, URL schemes that involve the direct use
  of an IP-based protocol to a specified host on the Internet use a
  common syntax for the scheme-specific data:

        //<user>:<password>@<host>:<port>/<url-path>
        Hide full text

        I think it is cheeky of us to use //
        our Iglu resources are resources
        not resources on hosts
        if that makes sense
        resolution to hosts is done inside Iglu
[14:05] Fred Blundun: I see what you mean
        Do you think iglu:... is better than iglu/...
[14:05] Alex Dean: it has to be iglu: to be a protocol
        The URI syntax consists of a URI scheme name (such as "http", "ftp", "mailto", "crid" or "file") followed by a colon character, and then by a scheme-specific part.
        to be a uri it has to start with a protocol
        so ours have to start with iglu:
        what we put after that is up to us
        I contend that /s between resource elements is good, and -s in SchemaVer is still good
        just // is misleading
[14:07] Fred Blundun: I think that's fair
[14:07] Alex Dean: okay cool
        I will create some tickets to change

Add NSURLConnection support

Reference issue #22 where we've decided to use the AFNetworking library to handle sending of events. If there's a need for using the native NSURLConnection sendSynchronousRequest:returningResponse:error: or NSURLConnection sendAsynchronousRequest:queue:completionHandler: to handle requests, comments should be added here.

Initial milestone is set for 0.3

Proper handling of failure cases to send events

We don't have a failure scenario if we're unable to send an event. This is probably related to #20 and #9 on how to handle this.

[manager GET:[self.urlEndpoint absoluteString] parameters:data success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
        //Handle GET error response
    }];

Force the use of setters if default init is used

The default - (id) init doesn't set most required options which need you to use the setters (i.e. setAppId, setUserId, setNamespace, setCollector) but we don't check if those have been set before attempting to flush all the events.

We should log an error in SnowplowTracker to stop and throw an error if this happens.

As opposed to the preferred:

- (id) initUsingNamespace:(NSString *)namespace_
                    appId:(NSString *)appId
            base64Encoded:(Boolean)encoded
                collector:(SnowplowRequest *)collector;

Fix unnecessary breaking of iglu schema tag

NSString * const kSnowplowVendor        = @"com.snowplowanalytics.snowplow";
NSString * const kIglu                  = @"iglu:";

I'm not sure why I did this in the first place, but it should be removed or set in a better way by using setSchemaTag:.

See: L#36 and L#84

EDIT: I remember now.
We need to stick iglu to the end of the vendor. Change setSchemaTag to setVendorAndSchema(vendor, schema) (or something like that).

  • vendor changes the whole url in case a user doesn't use iglu.
  • schema is for schema of the payload.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.