Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a way of setting customTrackingParameters to an Event and tracking custom Events. #188

Merged
merged 4 commits into from
Oct 8, 2017

Conversation

brototyp
Copy link
Member

@brototyp brototyp commented Oct 2, 2017

This is an implementation of #153, as an alternative of #154 which is much easier.

Example usage:

    private func example() {
        guard let piwikTracker = PiwikTracker.shared else { return }
        let downloadURL = URL(string: "https://builds.piwik.org/piwik.zip")!
        let event = Event(tracker: piwikTracker, action: ["menu", "some page", "downloadfile"], customTrackingParameters: ["download":downloadURL.absoluteString])
        PiwikTracker.shared?.track(event)
    }

Upsides:

  • Much easier usage. Create the event directly and the track it. No need to create intermediary events.
  • Adds only two new functions. A new initializer for the Event and a new function to track an event directly.

@brototyp
Copy link
Member Author

brototyp commented Oct 2, 2017

@minitrue22 Do you have any input to this?

@thorstenstark
Copy link
Collaborator

I like this way of setting custom parameters. But I'm currently not sure if this may have effects on the compatibility with obj-c.

@brototyp
Copy link
Member Author

brototyp commented Oct 6, 2017

What currently works with objc will still work. We didn't change the interface. I'm not sure if we will be able to pull of objc compatibility for the new features.

@brototyp
Copy link
Member Author

brototyp commented Oct 7, 2017

@thorstenstark I just implemented the rest, added example code and wrote the documentation.

@brototyp brototyp changed the title WIP: Added a way of setting customTrackingParameters to an Event and tracking custom Events. Added a way of setting customTrackingParameters to an Event and tracking custom Events. Oct 7, 2017
@brototyp brototyp mentioned this pull request Oct 7, 2017
2 tasks
Copy link
Collaborator

@thorstenstark thorstenstark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this.

@brototyp brototyp merged commit 3483c40 into develop Oct 8, 2017
@brototyp brototyp deleted the feature/153-custom-tracking-parameters-2 branch October 8, 2017 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants