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

Enhancement: Improve Event Names #19

Closed
jaswrks opened this Issue Sep 24, 2016 · 18 comments

Comments

Projects
None yet
3 participants
@jaswrks
Copy link

jaswrks commented Sep 24, 2016

The current event name for an order being received (which follows the advice to use verb-noun as suggested by Intercom API docs) is placed-order. This works well because it follows the idea of this being 'Their Activity'; i.e., the reason for a verb- prefix.

2016-09-24_02-11-43

However, we are listening for both processing and completed status changes, and potentially others in the future. As it stands now, there are going to be duplicate events (same order, same event name, back-to-back) posted to Intercom whenever this is running on a site that does implement a processing phase.

Instead of placed-order, we could do something that is WooCommerce-specific, such as: order-[status] and subscription-[status]. That would allow for additional statuses to be tracked later as well, without needing to use a different naming scheme. For example, it might be nice to add an order-refunded status event, or order-on-hold.

That doesn't work quite as well with the idea of this being 'Their Activity' though, because the leading verb is dropped. However, it does seem to me like a more informative approach given that what seems most important is to see the customer's activity as it relates to WooCommerce order statuses.

@raamdev Thoughts on this?

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Sep 24, 2016

Referencing a list of standard order statuses in WooCommerce.

/*
         * - `draft` When an order is still in the draft phase.
         *
         * - `pending` Order received (unpaid). e.g., abandoned orders have this status also.
         *
         * - `processing` Payment received & stock reduced. Awaiting review/fulfillment.
         *
         * - `on-hold` Stock is reduced. Awaiting payment.
         *
         * - `completed` Order fulfilled and complete.
         *
         * - `cancelled` Cancelled by an admin or the customer.
         *
         * - `refunded` Refunded by an admin or via a payment gateway notification.
         *
         * - `failed` Payment failed or was declined (unpaid). Note that this status may not show
         *            immediately and instead show as pending until verified (e.g., PayPal).
         */
@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Sep 26, 2016

That doesn't work quite as well with the idea of this being 'Their Activity' though, because the leading verb is dropped. However, it does seem to me like a more informative approach given that what seems most important is to see the customer's activity as it relates to WooCommerce order statuses.

I agree. I'd go with order-[woocommerce-order-status].

We should then document the above list of WooCommerce statuses in the WooCommerce Intercom docs so that site owners know what those various statuses mean when they see them inside Intercom.

@raamdev raamdev modified the milestone: Next Release Oct 31, 2016

jaswrks pushed a commit that referenced this issue Nov 19, 2016

jaswsinc

@jaswrks jaswrks referenced this issue Nov 19, 2016

Merged

PR: feature/19 #24

jaswrks pushed a commit that referenced this issue Nov 19, 2016

jaswsinc
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Next Release Changelog:

  • Standardizing Event names sent to Intercom. New format: order-[status]. See Issue #19.
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Noting that only two Order statuses are recorded at this time: processing and completed

  • order-processing
  • order-completed
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Potentially some other statuses once #1 is completed.

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Setting as partial-completion; pending KBA suggested in #19 (comment)

@jaswrks

This comment has been minimized.

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Support has been added for all WooCommerce events. See: #1 (comment)

@renzms

This comment has been minimized.

Copy link

renzms commented Nov 28, 2016

@raamdev @jaswsinc

Should it say: [order]/[subscription] +WooCommerce status/event?

Currently in Intercom it is only showing the WooCommerce status/event

screen shot 2016-11-28 at 10 20 14 pm

Tested using:

  • WP Sharks Core Version 161026.47592
  • WooCommerce Intercom Pro Version 161124.6961-RC
  • WooCommerce Version 2.6.8
@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Nov 28, 2016

@renzms That looks correct to me. Jason can correct me if I'm wrong, but I think it should exclude the the order- and subscription- prefix.

I'm adding a screenshot to the associated KB article to help clarify what those events will look like on the Intercom side.

jaswrks pushed a commit that referenced this issue Nov 28, 2016

jaswsinc
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 28, 2016

@renzms Thank you for catching this.

@renzms @raamdev Yes, it should have the order- and subscription- prefix. That was an error on my part and it has now been corrected in the RC and dev branch.

@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Nov 29, 2016

@jaswsinc Thanks!

@renzms Could you please re-test and take a new screenshot for me? I'd like to update the screenshot I added here.

@renzms

This comment has been minimized.

Copy link

renzms commented Nov 29, 2016

@jaswsinc @raamdev

Confirmed as working in latest build

Now has the order- prefix 👍

screen shot 2016-11-29 at 12 09 23 pm

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 29, 2016

@renzms Thanks! If it's not too much trouble, would it be possible for you to cut a screenshot that has the statuses in a more typical order please?

  • order-on-hold
  • order-processing
  • order-completed
  • order-refunded
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 29, 2016

Or am I just reading it in reverse and that's what you did?

@renzms

This comment has been minimized.

Copy link

renzms commented Nov 29, 2016

Or am I just reading it in reverse and that's what you did?

@jaswsinc

Hi Jason, in the original screenshot, it's actually 4 different orders and Intercom displays the latest Order Update Status first. 😃

So if you were to have 1 order go through the following updates:

    1. On-hold
    1. Processing
    1. Completed
    1. Order refunded

it would appear in the feed in Intercom in reverse order:

  • order-refunded
  • order-completed
  • order-processing
  • order-on-hold

I did however create a screenshot that has it in a typical order using 1 Order number if you'd like to use that for the KBA:

screen shot 2016-11-29 at 1 50 10 pm

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 29, 2016

I see. Thanks for explaining that. Makes sense to me now :-)

raamdev added a commit to wpsharks/woocommerce-intercom that referenced this issue Dec 10, 2016

Phing release of v161209.85885 with the following changes:
- **Bug Fix:** Call to undefined method `WC_Order::get_currency()` should be `get_order_currency()`. Reported by @raamdev in [this GitHub issue](wpsharks/woocommerce-intercom-pro#4).
- **Bug Fix:** Before a new Event is generated to track a user's Order or Subscription status on the Intercom side, a new API call is now made to ensure that a matching User does in fact exist on the Intercom side before an Event is created. This corrects a problem reported in the previous release that resulted in an error during checkout: `User Not Found`. See [Issue #6](wpsharks/woocommerce-intercom-pro#6 (comment))
- **Bug Fix:** In the Event API calls, `amount` must be given in **cents** (i.e., total x 100) for proper calculation on the Intercom side. Closes [this GitHub issue](wpsharks/woocommerce-intercom-pro#17).
- **New Feature:** It is now possible to configure the Intercom Messenger icon display settings so that it's only shown to logged-in users, only to logged-out users, or to everyone (default behavior). See: **Dashboard → WooCommerce → Intercom → Messenger Display Options**.
- **New Feature:** Adding support for URI Inclusion patterns. See [Issue #12](wpsharks/woocommerce-intercom-pro#12).
- **New Feature:** Adding support for URI Exclusion patterns. See [Issue #12](wpsharks/woocommerce-intercom-pro#12).
- **New People Attribute:** This release adds a new People Attribute by the name of `wp_user_id`, giving support reps. the ability to track WP User IDs in Intercom.
- **New Filter:** A new filter has been exposed: `js_snippet_attrs`. This allows a developer to add their own custom attributes; above and beyond what is already defined by WooCommerce Intercom Pro itself.
- **New Filter:** `add_filter('woocommerce_intercom_js_snippet_enable', '__return_false');` to disable the JS snippet selectively.
- **Enhancement:** Standardizing Event names sent to Intercom. New format: `order-[status]`. See [Issue #19](wpsharks/woocommerce-intercom-pro#19).
- **Enhancement:** Adding `wp_home_url` and `wp_network_home_url` fields to JS Snippet to make it easier for support representatives to identify the origin of a customer request; e.g., whenever a single Intercom account is being used to support more then one WordPress installation, or multiple child sites/domains in a Multisite Network. See [Issue #22](wpsharks/woocommerce-intercom-pro#22).
- **Intercom `user_id`:** This release changes the way an Intercom `user_id` is generated. Instead of just the WP User ID, the Intercom `user_id` is now formulated in a way that allows a single Intercom account to be used for multiple installations of WordPress. The `user_id` sent to Intercom is now made up of two parts. 1. A hash of the current WordPress `home_url()` (normalized). 2. The current user's WordPress ID (or, in the case of guest checkout, an `e-`, followed by a hash of the user's email address). The final `user_id` becomes: `[location hash].[user ID]`; e.g., `3610a686.123`, `3610a686.e-9943c993` (guest).
- **Compatibility:** Adding support and compatibility with WPML's `ICL_LANGUAGE_CODE` so the Intercom messenger will always be displayed in an appropriate language.
- **Compatibility:** This release adds compatibility with WooCommerce Subscriptions. See [Issue #1](wpsharks/woocommerce-intercom-pro#1).
- **Compatibility:** This release adds support for all WooCommerce Order and/or Subscription status changes, including those added by WooCommerce extensions such as the WooCommerce Give Order extension. See [Issue #1](wpsharks/woocommerce-intercom-pro#1).
- **Compatibility:** Removing API Key setting for Intercom in favor of a Personal Access Token. There is now a configuration field under: **WP Dashboard → WooCommerce → Intercom** settings where you can supply a Personal Access Token for API calls to Intercom. Use the instructions provided in this area to generate and fill-in your Personal Access Token. See [Issue #20](wpsharks/woocommerce-intercom-pro#20).
- **Compatibility:** Adding support for guest checkout events that track a customer by email address instead of by user ID. Closes [this GitHub issue](wpsharks/woocommerce-intercom-pro#6).
- **Compatibility:** Updating `composer.json` to specify that we will use the Intercom SDK v3.x (but not 4.x) until a full review of a new major release has been completed.
- **Cleanup:** Moving JS snippet into a template file w/ replacement code. Closes [this GitHub issue](wpsharks/woocommerce-intercom-pro#8).
@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Dec 10, 2016

WooCommerce Intercom Pro v161209.85885 has been released and includes changes from this GitHub Issue. See the changelog for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#19).

@raamdev raamdev closed this Dec 10, 2016

@wpsharks wpsharks locked and limited conversation to collaborators Dec 10, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.