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

Feature/111 custom dimensions with action scope #193

Merged
merged 3 commits into from
Oct 14, 2017

Conversation

brototyp
Copy link
Member

@brototyp brototyp commented Oct 9, 2017

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.

@brototyp brototyp requested a review from thorstenstark October 9, 2017 19:42
@@ -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
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! Done

@@ -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] = []) {
Copy link
Collaborator

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.

Copy link
Member Author

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

@brototyp brototyp force-pushed the feature/111-custom-dimensions-with-action-scope branch from 46ec4c5 to edf632f Compare October 14, 2017 10:05
@brototyp brototyp force-pushed the feature/111-custom-dimensions-with-action-scope branch from edf632f to 39db067 Compare October 14, 2017 10:07
@brototyp brototyp merged commit c0c4d37 into develop Oct 14, 2017
@brototyp brototyp deleted the feature/111-custom-dimensions-with-action-scope branch October 14, 2017 10:18
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