-
Notifications
You must be signed in to change notification settings - Fork 8
[REM-3041] Display ads tracking #265
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
Open
ZSnake
wants to merge
10
commits into
master
Choose a base branch
from
REM-3041/display-ads-tracking
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aa1c07c
[REM-3041] Add functions to emit tracking events for display ads medi…
ZSnake 3f7645d
Merge branch 'master' into REM-3041/display-ads-tracking
ZSnake 6eeb2fa
[REM-3041] update branch and regenerate docs
ZSnake d6e73c0
[REM-3041] Revert deployment target changes
ZSnake 2961692
Revert docs
esezen 4f622c9
[REM-3041] Revert Pods changes
ZSnake 5852bb3
[REM-3041] Remove generated target support files
ZSnake ca7fc2f
[REM-3041] Fix tests build errors, add bannerAdId guard on media impr…
ZSnake 58f29ae
[REM-3041] Remove tracking data structures from docs
ZSnake 1984aa8
[REM-3041] Fix tests to remove actual API call and refactor for stubbing
ZSnake File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
AutocompleteClient/FW/Logic/Request/CIOTrackMediaImpressionClickData.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // | ||
| // CIOTrackMediaImpressionClickData.swift | ||
| // AutocompleteClient | ||
| // | ||
| // Copyright (c) Constructor.io Corporation. All rights reserved. | ||
| // http://constructor.io/ | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| /** | ||
| Struct encapsulating the parameters that must/can be set in order to track a media impression click | ||
| */ | ||
| struct CIOTrackMediaImpressionClickData: CIORequestData { | ||
|
|
||
| let bannerAdId: String | ||
| let placementId: String | ||
|
|
||
| func url(with baseURL: String) -> String { | ||
| return String(format: Constants.TrackMediaImpressionClick.format, baseURL) | ||
| } | ||
|
|
||
| func urlWithFormat(baseURL: String, format: String) -> String { | ||
| return String(format: format, baseURL) | ||
| } | ||
|
|
||
| init(bannerAdId: String, placementId: String) { | ||
| self.bannerAdId = bannerAdId | ||
| self.placementId = placementId | ||
| } | ||
|
|
||
| func decorateRequest(requestBuilder: RequestBuilder) {} | ||
|
|
||
| func httpMethod() -> String { | ||
| return "POST" | ||
| } | ||
|
|
||
| func httpBody(baseParams: [String: Any]) -> Data? { | ||
| var dict = [ | ||
| "banner_ad_id": self.bannerAdId, | ||
| "placement_id": self.placementId | ||
| ] as [String: Any] | ||
|
|
||
| dict["beacon"] = true | ||
| dict.merge(baseParams) { current, _ in current } | ||
|
|
||
| return try? JSONSerialization.data(withJSONObject: dict) | ||
| } | ||
| } |
49 changes: 49 additions & 0 deletions
49
AutocompleteClient/FW/Logic/Request/CIOTrackMediaImpressionViewData.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // | ||
| // CIOTrackMediaImpressionViewData.swift | ||
| // AutocompleteClient | ||
| // | ||
| // Copyright (c) Constructor.io Corporation. All rights reserved. | ||
| // http://constructor.io/ | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| /** | ||
| Struct encapsulating the parameters that must/can be set in order to track a media impression view | ||
| */ | ||
| struct CIOTrackMediaImpressionViewData: CIORequestData { | ||
|
|
||
| let bannerAdId: String | ||
| let placementId: String | ||
|
|
||
| func url(with baseURL: String) -> String { | ||
| return String(format: Constants.TrackMediaImpressionView.format, baseURL) | ||
| } | ||
|
|
||
| func urlWithFormat(baseURL: String, format: String) -> String { | ||
| return String(format: format, baseURL) | ||
| } | ||
|
|
||
| init(bannerAdId: String, placementId: String) { | ||
| self.bannerAdId = bannerAdId | ||
| self.placementId = placementId | ||
| } | ||
|
|
||
| func decorateRequest(requestBuilder: RequestBuilder) {} | ||
|
|
||
| func httpMethod() -> String { | ||
| return "POST" | ||
| } | ||
|
|
||
| func httpBody(baseParams: [String: Any]) -> Data? { | ||
| var dict = [ | ||
| "banner_ad_id": self.bannerAdId, | ||
| "placement_id": self.placementId | ||
| ] as [String: Any] | ||
|
|
||
| dict["beacon"] = true | ||
| dict.merge(baseParams) { current, _ in current } | ||
|
|
||
| return try? JSONSerialization.data(withJSONObject: dict) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Public API naming: new methods use
bannerAdId/placementId, but the existing public API consistently uses...ID(e.g.,quizID,resultID,itemID). Consider renaming these parameters tobannerAdID/placementID(and aligning related types/docs/tests) now to keep the API consistent before release.