Skip to content

[FIX] website ecommerce tracking: payment blocked by GA4 clobbering advanced_tracking JSON helpers - #467

Closed
ALopez-Adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-h-121712-loa
Closed

[FIX] website ecommerce tracking: payment blocked by GA4 clobbering advanced_tracking JSON helpers#467
ALopez-Adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-h-121712-loa

Conversation

@ALopez-Adhoc

@ALopez-Adhoc ALopez-Adhoc commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Ticket

OBA 121712 — no funciona el pago demo en runbot

Root cause

website_sale_google_analytics_4 overrode sale.order.prepare_purchase_information()
and sale.order.line.prepare_checkout_information() (owned by
website_sale_advanced_tracking, return type = JSON string) with a python
dict/list. With both modules installed GA4 wins the MRO, QWeb renders a python
repr (single quotes) into data-purchase_info, and JSON.parse throws in the
facebook_pixel / GTM PaymentForm.submitForm override, blocking
super.submitForm(). Result: the pay button does nothing. Latent,
load-order-dependent collision (two sibling modules redefining the same method
with different contracts).

Fix

  • Namespace the GA4 helpers (ga4_purchase_information / ga4_checkout_information)
    so they stop clobbering the shared contract. No change to advanced_tracking /
    facebook / GTM behaviour.
  • Keep the defensive try/catch in facebook_pixel_tracking.submitForm as a
    safety net so tracking can never block checkout again.

Testing

  • odoo shell (build 92149-19-0-all): prepare_purchase_information() returns a
    JSON string again; JSON.parse(data-purchase_info) OK for public and portal
    orders.
  • Manual: cart -> checkout -> pay (Demo provider) logged in as portal customer;
    checkout proceeds and AddToCart / InitiateCheckout / Purchase fire in console.

@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

…avoid clobbering advanced_tracking

website_sale_advanced_tracking exposes prepare_purchase_information() and
prepare_checkout_information() on sale.order(.line) returning a JSON string
(json.dumps), consumed as-is by the facebook_pixel_tracking and
google_tag_manager_advanced_tracking checkout interactions (JSON.parse on
data-purchase_info / data-cart_info).

This module redefined those same methods with an incompatible return type
(python dict/list) for its own GA4 templates, silently overriding the shared
ones when both modules are installed. QWeb then rendered a python repr (single
quotes) into data-purchase_info, so JSON.parse threw in PaymentForm.submitForm
and super.submitForm() never ran: the pay button did nothing (task 121712,
"no funciona el pago demo en runbot").

Rename the GA4 helpers to ga4_purchase_information() / ga4_checkout_information()
so they no longer collide with the shared contract. GA4 templates and the
Measurement Protocol confirmation hook use the namespaced names;
advanced_tracking / facebook / GTM keep receiving a valid JSON string.

Also keep the defensive try/catch in facebook_pixel_tracking.submitForm so a
tracking error can never block the payment flow again.
@ALopez-Adhoc ALopez-Adhoc changed the title [FIX] facebook_pixel_tracking: don't block checkout on invalid purchase_info [FIX] website ecommerce tracking: payment blocked by GA4 clobbering advanced_tracking JSON helpers Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants