Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Add explat variation for wc pay promotion #7554

Merged
merged 3 commits into from Sep 10, 2021
Merged

Conversation

louwie17
Copy link
Contributor

@louwie17 louwie17 commented Aug 24, 2021

Changes for #7319

Adds an experimental ab test class to allow running explat experiments in PHP, this is temporary and will be replace by a Jetpack library once Jetpack has been updated. I talked with @adrianduffell about this (same is happening on WC Pay at the moment).
Making use of the experiment in the WC Pay promotion.

No changelog added, as it will be in the final PR enabling it on all environments.

Detailed test instructions:

*Make sure you don't have WooCommerce Payments installed or enabled.
*Make sure you have logging enabled

  • Have a local version of woocommerce.com running using the branch of this PR (add/payment-method-recommendation-endpoint) -> 11084-gh-Automattic/woocommerce.com
  • Change the url in the DataSourcePoller.php to point to your local version with to http://woocommerce.test or using your local ip might work as well - http://192....
    you might have to remove the woocommerce_admin_payment_method_promotion_specs transient.
  • To test this locally, pre-fix the experiment name with explat_test_v3_ here so it reads - explat_test_v3_woocommerce_wc_pay_promotion_payment_methods_table_
  • It should default to control, meaning the WooCommerce Payments should not be displayed in the payment method table in WooCommerce > Settings > Payments
  • Now go to the Abacus experiment and add the treatment bookmarklet to your bookmarks (instructions)
  • Go back to you local instance and click on the treatment bookmarklet, a pop up should appear with a success message
  • Now remove the abtest_variation_explat_test_v3_woocommerce_wc_pay_promotion_payment_methods_table_v1 transient, you can use wp transient delete ...
  • Refresh the WooCommerce > Settings > Payments page, the treatment experiment should be activated now and WooCommerce Payments displayed in the payment method table with the install button.

@joshuatf
Copy link
Contributor

joshuatf commented Sep 8, 2021

@louwie17 When this has been rebased, please ping me and I'll take a look.

@louwie17 louwie17 force-pushed the feature/7319_add_explat_logic branch from 23da7cf to 02d90fc Compare September 9, 2021 12:23
Base automatically changed from feature/7319_add_woocommerce_com_data to main September 9, 2021 12:25
@louwie17 louwie17 force-pushed the feature/7319_add_explat_logic branch from 02d90fc to 219e732 Compare September 9, 2021 12:29
@louwie17
Copy link
Contributor Author

louwie17 commented Sep 9, 2021

@louwie17 When this has been rebased, please ping me and I'll take a look.

This has been rebased and updated to work with the latest wc.com data structure.

Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

Looks great and is testing well! Left a couple minor comments, but pre-approving. The property check is the main one worth considering since this call will live in perpetuity in older WCA versions.

Not directly related to this PR, but noticed this error when initially fetching transients. Seems to be stemming from merge_specs():

Screen Shot 2021-09-09 at 11 29 08 AM

$allow_tracking
);

$variation_name = $abtest->get_variation( 'woocommerce_wc_pay_promotion_payment_methods_table_' . $wc_pay_spec->additional_info->experiment_version );
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to double check that experiment_version exists above first or are we sure it will always exist on this API going forward?

This will be a public API, so anything we add here will continue to be used for the same request in the future with this version of WooCommerce Admin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I should probably do that as well

@@ -0,0 +1,173 @@
<?php
/**
* A class that interacts with Explat A/B tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add some comments here with the source URL this was copied from and any notes about when we can remove this in the future (if applicable)?

@joshuatf joshuatf added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. and removed status: needs review labels Sep 9, 2021
@louwie17 louwie17 merged commit cb82975 into main Sep 10, 2021
@louwie17 louwie17 deleted the feature/7319_add_explat_logic branch September 10, 2021 13:50
ObliviousHarmony pushed a commit to woocommerce/woocommerce that referenced this pull request Mar 18, 2022
…min#7554)

* Add experimental abtest class and use it in WCPayPromotion

* Update experiment version data structure

* Address PR feedback
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: author feedback The issue/PR needs a response from any of the parties involved in the issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants