Skip to content

Conversation

@joshheald
Copy link
Contributor

@joshheald joshheald commented Oct 31, 2022

Closes: #7855

Description

#7973 Added the call to action button to a Just in Time Message, but didn't tackle the analytics for tapping it, nor adding the UTM parameters to the URL if it was for a woocommerce.com link.

This PR resolves those two outstanding items

Testing instructions

N.B. see pdfdoF-1uc-p2#comment-2581 for details of setting up your store to be eligible for the test JITM

UTM params

  • utm_medium: woo_ios
  • utm_campaign: jitm_group_{FEATURE_CLASS} i.e. jitm_group_woomobile_ipp
  • utm_source: my_store
  • utm_term: Blog ID
  • utm_content: jitm_{JITM_ID} i.e. jitm_woomobile_ipp_barcode_users

With a US store that is eligible for the test JITM, on a debug/alpha build of the app

  1. Put a breakpoint on the webview view model creation line, or attach the web inspector to your device/simulator
  2. Open the app
  3. Observe that the message is shown
  4. Tap the CTA
  5. Observe in the debugger/inspector that the URL has the expected UTM parameters

Analytics event

  • Track *_jitm_cta_tapped event
  • with props jitm_group: {FEATURE_CLASS}, jitm_id: {JITM_ID}, source: my_store
  1. Follow the above steps and observe the event printed in the debug output.
  2. Check the Live View in Tracks to see the event.

Screenshots

UTM Parameters

Debug print of the URL used for the webview when the CTA is tapped

Analytics event

Debug print of the jitm_cta_tapped analytics event with properties

Tracks event in live view


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@joshheald joshheald added type: enhancement A request for an enhancement. category: tracks Related to analytics, including Tracks Events. feature: jitm Related to Just In Time Messages labels Oct 31, 2022
@joshheald joshheald added this to the 11.1 milestone Oct 31, 2022
@joshheald joshheald changed the base branch from trunk to issue/7855-open-webview-for-jitm-cta October 31, 2022 16:47
@joshheald joshheald marked this pull request as ready for review October 31, 2022 17:01
@joshheald joshheald requested review from koke and pachlava October 31, 2022 17:02
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 31, 2022

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr7991-4abfd84 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

…tm-params-and-analytics-on-JITM-cta

# Conflicts:
#	WooCommerce/Classes/ViewRelated/Dashboard/DashboardViewModel.swift
Base automatically changed from issue/7855-open-webview-for-jitm-cta to trunk October 31, 2022 17:52
…-cta

# Conflicts:
#	WooCommerce/Classes/ViewModels/Feature Announcement Cards/JustInTimeMessageAnnouncementCardViewModel.swift
Copy link
Contributor

@pachlava pachlava left a comment

Choose a reason for hiding this comment

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

Everything worked as you describe @joshheald. I could see the track event with mentioned props, and also the request with the expected params:

Screenshot 2022-11-01 at 14 24 54

I have a question not related to the PR. It looks like Add products to sell banner, that is shown in My store when there are no products, has a precedence over JITM banner. However, once the banner is tapped, and the product had been added, it won't be shown again. I'd expect JITM banner to appear there after screen reload, but it only happens if I switch the store. Is this something known? Thanks!

Screen.Recording.2022-11-01.at.14.48.43.mov

@joshheald
Copy link
Contributor Author

Thanks @pachlava!

I have a question not related to the PR. It looks like Add products to sell banner, that is shown in My store when there are no products, has a precedence over JITM banner. However, once the banner is tapped, and the product had been added, it won't be shown again. I'd expect JITM banner to appear there after screen reload, but it only happens if I switch the store. Is this something known? Thanks!

I hadn't actually tested this yet, but it's not a surprise. Similarly, we don't refresh the JITM except for a full relaunch of the app, logging out and back in, or switching stores, so it could be very out of date in a realistic scenario. This is because we currently do it on viewDidLoad.

I'm going to sync the JITM with the same refresh behaviour as the rest of the screen in a future PR, but I'll also make sure to sync it after the products banner is dismissed. Thanks for pointing it out!

@joshheald joshheald requested review from toupper and removed request for koke November 1, 2022 13:35
@toupper toupper self-assigned this Nov 2, 2022
@toupper
Copy link
Contributor

toupper commented Nov 2, 2022

ILGTM! 🎉 :shipit:

@joshheald joshheald merged commit 03c3c20 into trunk Nov 2, 2022
@joshheald joshheald deleted the issue/7855-utm-params-and-analytics-on-JITM-cta branch November 2, 2022 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events. feature: jitm Related to Just In Time Messages type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Just In Time Messages] Open JITM link in webview when CTA tapped

5 participants