Closed jorgemd24 closed 1 month ago
Hi @mikkamp thanks for the review! I liked your suggestion about detecting the user agent in the client, (see my comment) so I went ahead and I moved the logic to the client. Can you have another look? Thanks.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 64.7%. Comparing base (
182b5dd
) to head (aa6185e
). Report is 6 commits behind head on develop.
Thanks @mikkamp for the review! I've addressed all your comments.
Just looking at this track here. Wouldn't it be useful to also pass the source? Or is it going to still include the user agent string so it can be extracted from there?
I think it is good to add the source in the event tracking so I've added it here: aa6185e
Changes proposed in this Pull Request:
Part of pcTzPl-2nS-p2
This PR will automatically label campaigns created via the WC Mobile App by checking the user agent headers. The labels used will be
wc-android
orwc-ios
. If the campaign isn't created through the WC Mobile App, it will be labeled aswc-web
.Screenshots:
Detailed test instructions:
POST /wp-json/wc/gla/ads/campaigns
with theUser Agent
header set to something like:Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 wc-ios/19.7.1
. Set the below body:wc-ios
orwc-android
.wc-web
Additional details:
Changelog entry