-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug-fix: Measurement Protocol Message (#68)
* implemeting user parameter and event parameters for MP api * validating new MP message payload * removing bad strings from client_id - MP message payload --------- Co-authored-by: Carlos Timoteo <[email protected]>
- Loading branch information
1 parent
963573e
commit 29efe2a
Showing
10 changed files
with
114 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -1,21 +1,8 @@ | ||
SELECT user_pseudo_id AS client_id, | ||
EXTRACT(DATE FROM processed_timestamp AT TIME ZONE 'UTC') AS inference_date, | ||
prediction, | ||
active_users_past_1_7_day AS active_users_past_1_7, | ||
active_users_past_8_14_day AS active_users_past_8_14, | ||
purchases_past_1_7_day AS purchases_past_1_7, | ||
purchases_past_8_14_day AS purchases_past_8_14, | ||
visits_past_1_7_day AS visits_past_1_7, | ||
visits_past_8_14_day AS visits_past_8_14, | ||
view_items_past_1_7_day AS view_items_past_1_7, | ||
view_items_past_8_14_day AS view_items_past_8_14, | ||
add_to_carts_past_1_7_day AS add_to_carts_past_1_7, | ||
add_to_carts_past_8_14_day AS add_to_carts_past_8_14, | ||
checkouts_past_1_7_day AS checkouts_past_1_7, | ||
checkouts_past_8_14_day AS checkouts_past_8_14, | ||
ltv_revenue_past_1_7_day AS ltv_revenue_past_1_7, | ||
ltv_revenue_past_7_15_day AS ltv_revenue_past_7_15, | ||
geo_region | ||
FROM `{{source_table}}` | ||
WHERE prediction IS NOT NULL | ||
LIMIT 10000 | ||
SELECT | ||
prediction, | ||
COALESCE(user_id, user_pseudo_id) AS client_id, | ||
EXTRACT(DATE FROM processed_timestamp AT TIME ZONE 'UTC') AS inference_date, | ||
FROM `{{source_table}}` | ||
WHERE prediction IS NOT NULL | ||
LIMIT 10000 | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
SELECT | ||
user_id AS client_id, | ||
EXTRACT(DATE FROM feature_timestamp AT TIME ZONE 'UTC') AS inference_date, | ||
prediction as prediction | ||
FROM `{{source_table}}` | ||
WHERE prediction IS NOT NULL | ||
LIMIT 10000 | ||
prediction, | ||
user_id AS client_id, | ||
EXTRACT(DATE FROM feature_timestamp AT TIME ZONE 'UTC') AS inference_date, | ||
FROM `{{source_table}}` | ||
WHERE prediction IS NOT NULL | ||
LIMIT 10000 |
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
SELECT * EXCEPT(user_pseudo_id, processed_timestamp), | ||
user_pseudo_id AS client_id, | ||
EXTRACT(DATE FROM processed_timestamp AT TIME ZONE 'UTC') AS inference_date | ||
FROM `{{source_table}}` | ||
WHERE prediction > 0 | ||
ORDER BY prediction DESC | ||
LIMIT 10000 | ||
SELECT | ||
prediction, | ||
user_pseudo_id AS client_id, | ||
EXTRACT(DATE FROM processed_timestamp AT TIME ZONE 'UTC') AS inference_date, | ||
FROM `{{source_table}}` | ||
WHERE prediction > 0 | ||
ORDER BY prediction DESC | ||
LIMIT 10000 |
This file contains 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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
SELECT * EXCEPT(user_pseudo_id, processed_timestamp, user_id), | ||
user_pseudo_id AS client_id, | ||
EXTRACT(DATE FROM processed_timestamp AT TIME ZONE 'UTC') AS inference_date | ||
FROM `{{source_table}}` | ||
WHERE prediction = 'true' | ||
ORDER BY prediction_prob DESC | ||
LIMIT 10000 | ||
SELECT | ||
prediction, | ||
prediction_prob, | ||
COALESCE(user_id, user_pseudo_id) AS client_id, | ||
EXTRACT(DATE FROM processed_timestamp AT TIME ZONE 'UTC') AS inference_date, | ||
FROM `{{source_table}}` | ||
WHERE prediction = 'true' | ||
ORDER BY prediction_prob DESC | ||
LIMIT 10000 |
This file contains 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