WPCOM API: Site Settings: Additional fields for Google Analytics D8279 #8198
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.
This commit syncs r165593-wpcom.
Related issue: #8181
Module change forthcoming in a separate PR: #8182
Changes proposed in this Pull Request:
Testing instructions:
Fire up postman
Set your headers to
Content-Type: application/json
Authorization: X-WPCOOKIE (steal a token from a developer REST API console request)
Origin: https://developer.wordpress.com
(you'll need to use Postman Interceptor to pull that off)
First, let's double check the 1.3 endpoint for regression
Direct a v1.3 GET request at /site/{siteID}/settings ( e.g. /sites/87832313/settings )
( i.e. public-api.wordpress.com/rest/v1.3/sites/87832313/settings )
Ensure you get a wga key in the response and that it has the following sub-keys
code, anonymize_ip, ec_track_purchases, and ec_track_add_to_cart
Direct a v1.3 POST request to /site/{siteID}/settings ( e.g. /sites/87832313/settings )
Set the body to something like
Note: For v1 compatibility, all requests must include the code field. All other fields are optional
Now, let's test the 1.4 endpoint.
Direct a v1.4 GET request at /site/{siteID}/settings ( e.g. /sites/87832313/settings )
( i.e. public-api.wordpress.com/rest/v1.4/sites/87832313/settings )
Ensure you get a wga key in the response and that it has the following sub-keys
code, anonymize_ip, ec_track_purchases, ec_track_add_to_cart, enh_ec_tracking,
enh_ec_track_remove_from_cart, enh_ec_track_prod_impression, enh_ec_track_prod_click,
enh_ec_track_prod_detail_view, enh_ec_track_checkout_started
Direct a v1.4 POST request to /site/{siteID}/settings ( e.g. /sites/87832313/settings )
Set the body to something like
Note: For v1 compatibility, all requests must include the code field. All other fields are optional
Try a few combinations to ensure it works well.
cc @justinshreve