Prevent usage of tempstore to prevent starting unnecessary session

Created on 7 September 2022, about 2 years ago
Updated 23 February 2024, 9 months ago

Problem/Motivation

Currently, when events are being triggered they are being stored in the current user's tempstore. When a anonymous user triggers these events we'll start a session which will impact the page caching significantly and slows down the entire experience. In most Commerce situations this is probably no biggy since most stores will probably use logged in users. We're on the other hand are allowing anonymous users to order products.

Steps to reproduce

Trigger a event like productDetailViews as a anonymous user and note that you get a session cookie assigned.

Proposed resolution

Looking at the module, I think the only reason why we're using tempstore is because there is a route endpoint which exposes the events as a JSON response, allowing JS to fetch these events and sending them client-side to GTM. I'm wondering if there would be any downside of sending these events server-side, but I'm not familiar enough with GTM to know the pros/cons. If this is possible, we'd be able to store the events within the same request which would eliminate the need for tempstore.

Remaining tasks

Discovery of possibility to send events to GTM server-side.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Feature request
Status

Active

Version

2.0

Component

Miscellaneous

Created by

🇳🇱Netherlands aken.niels@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024