-
Notifications
You must be signed in to change notification settings - Fork 166
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
Feature/111 custom dimensions with action scope #193
Feature/111 custom dimensions with action scope #193
Conversation
@@ -260,13 +216,15 @@ extension PiwikTracker { | |||
/// | |||
/// - Parameter view: An array of hierarchical screen names. | |||
/// - Parameter url: The url of the page that was viewed. If none set the url will be http://example.com appended by the screen segments. Example: http://example.com/players/john-appleseed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation here should mention the dimensions
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Done
PiwikTracker/PiwikTracker.swift
Outdated
@@ -260,13 +216,15 @@ extension PiwikTracker { | |||
/// | |||
/// - Parameter view: An array of hierarchical screen names. | |||
/// - Parameter url: The url of the page that was viewed. If none set the url will be http://example.com appended by the screen segments. Example: http://example.com/players/john-appleseed | |||
@objc public func track(view: [String], url: URL? = nil) { | |||
queue(event: event(action: view, url: url)) | |||
public func track(view: [String], url: URL? = nil, dimensions: [CustomDimension] = []) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As CustomDimension
isn't visible to objc, I'm not sure if these methods are still visible to objc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a Objective-C extension without the dimensions property. See https://github.com/piwik/piwik-sdk-ios/pull/193/files#diff-bd7b3c5478dc6552eb40fd9baaa55d18R289
46ec4c5
to
edf632f
Compare
edf632f
to
39db067
Compare
Implements #111 for the action scope.
Basically I made the
CustomDimension
struct public and added an optional parameter to the tracking functions to add additional dimensions.Since the
CustomDimension
is a struct, it is not usable from Objective-C. Still I think this is the best idea.