Skip to content

Format WooCommerce Conversion Event Values to Be Decimal Value as Opposed to Whole Cents Only #10974

@10upsimon

Description

@10upsimon

Feature Description

Recently, we extended the Enhanced Conversion Tracking suite to track event values for addToCarts and purchase events, for users with WooCommerce installed.

At the time, it was thought that Google for WooCommerce sent the values as whole cent values, where 100.00 would become 10000 etc.

Recently, however, users began to open support issues around this, such as #10972

Upon further investigation, it appears as though the values were only temporarily converted to cents by Google for WooCommerce, but converted back to decimal values prior to sending as event data.

Fixes should be made to ensure that event values sent for addToCarts and purchase events are in decimal format, i.e. 100.25.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Total addToCart and purchase event values - when sent to GA4 - should be formatted with decimal points, and not whole values including cents.

Implementation Brief

Test Coverage

  • No updates needed

QA Brief

  • Set up Site Kit with GA4 enabled, ensure that conversion tracking is enabled (it should be by default)
  • Set up WooCommerce and add a single product with price including cents, i.e 250.75
  • Navigate to the Uncategorised archive for products (product-category/uncategorized/)
  • Open Google Tag Assistant so you can debug the events
  • Click Add to Cart on the product
  • Validate the the price value sent is in decimal format, i.e. 250.75
  • Add the product to the cart again to increase the value
  • Complete the purchase
  • Ensure that the total purchase event amount is also in decimal format
  • Note, if you choose a whole product price such as 500, the value is sent as 500 and not 500.00

Changelog entry

  • Fix bug that could cause some WooCommerce events to have inaccurate prices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module: AnalyticsGoogle Analytics module related issuesP1Medium priorityTeam SIssues for Squad 1Type: EnhancementImprovement of an existing featurejavascriptPull requests that update Javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions