-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add plugin integration for WooCommerce #8553
Comments
AC ✔️ |
@benbowler Added event name we should track in the AC |
Thanks @zutigrm I didn't get as much time as I hoped to work on this ticket today so have un-assigned while I'm out for others to work on. |
IB ✔️ |
QA Update ❌
@eugene-manuilov In my test Recording.912.mp4 |
@mohitwp, unfortunately, there must be a perfect theme to get it working correctly. The Astra theme doesn't use the Regarding adding products to the cart, it will work from the shop page since adding products there works using expected markup that is compatible with Woocommerce js. On the single product page, it won't work because it doesn't use js to process when the user clicks on the add to cart button. |
QA Update
|
QA Update ❌
@eugene-manuilov For me |
@aaemnnosttv do you mind looking into it? |
Let's leave this for now. We can address it in a follow-up to improve the accuracy. Until then it's behind a feature flag. |
Feature Description
WooCommerce conversion events should be supported in the new conversion event tracking infrastructure.
See implementation and class design and plugin specific notes section in the design doc
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
add_to_cart
conversion event should be tracked.purchase
conversion event should be sentImplementation Brief
Google\Site_Kit\Core\Conversion_Tracking\Conversion_Event_Providers\WooCommerce
Google\Site_Kit\Core\Conversion_Tracking\Conversion_Events_Provider
interface.conversion_provider_slug
with a value, saywoocommerce
is_active
- check ifWC_PLUGIN_FILE
constant is definedtrue
if it isfalse
get_event_names
- return an associative array contain two valuesadd_to_cart
andpurchase
register_script
- Instantiate theGoogle\Site_Kit\Core\Assets\Script
class and register the script, leveraging the execution argument for deferring the script. It should return the Script instance.Script
class heresite-kit-wp/includes/Core/Assets/Assets.php
Lines 441 to 449 in fd7efe4
woocommerce
script as dependency'execution' => 'defer'
gsk-cep-{$this->conversion_provider_slug}
Script
instanceassets/js/event-providers/woocommerce.js
.on()
listener should be used, examples:conversionEventProviders.config.js
webpack partial added in Add Webpack Partial That Will Build Conversion Providers Specific JS Files #8531yield conversionEventProviders( mode );
is run in the mainwebpack.config.js
config (it is commented out while there are no entry points)Conversion_Events
class property added in Add MainConversion_Tracking
Class #8528Test Coverage
WooCommerce
class, testing thatget_event_names method
returns correct event names, andregister_script
returns script instance with proper handle. Alsois_active
can be confirmed by defining the plugin constantQA Brief
conversionInfra
feature flag for your siteChangelog entry
The text was updated successfully, but these errors were encountered: