Skip to content

[ps_googleanalytics]: add_to_cart event in realtime #37661

@kreare

Description

@kreare

Prerequisites

Describe the bug and add attachments

Currently, the ps_googleanalytics module doesn't send events when they occurs (like the add to cart even) but add them on a queue, flushed on the next page load/change

This could be good for some events, but it loose a lot of add_to_cart events especially if you use a theme with an ajax add to cart button or if you have the redirect to cart disabled (default, I think).

In this case, the event is scheduled, but never sent to google if customer leave the website. I can see a lot of events still stored in the table, and they are never flushed, probably because the customer has left the website just after pressing the add to cart button.

Expected behavior

Events sent as soon as they occurs, not only queued for later flush

Steps to reproduce

  1. press 'add to cart' button
  2. close the website without changing the page

PrestaShop version(s) where the bug happened

8.1

PHP version(s) where the bug happened

No response

If your bug is related to a module, specify its name and its version

ps_googleanalytics

Your company or customer's name goes here (if applicable).

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    9.0.xBranchBugType: BugGoogle AnalyticsModule: ps_googleanalyticsNMIStatus: issue needs more informationPR availableSolution: issue is being addressedWaiting for authorStatus: action required, waiting for author feedback

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions