Skip to content
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

If persist any kind of redirect, the data is lost #43

Open
alexkingdom opened this issue Sep 18, 2021 · 6 comments
Open

If persist any kind of redirect, the data is lost #43

alexkingdom opened this issue Sep 18, 2021 · 6 comments

Comments

@alexkingdom
Copy link

Seems this bundle doesn't care about situation when for example user paid something and we redirect to success page.
I think we need to use something like flash messages in symfony that will show one time the data.

What do you think ?

@xyNNN
Copy link
Owner

xyNNN commented Sep 20, 2021

What do you mean? Can you explain a bit more your issue or use case? And where do you think that the bundle should cover this task?

@alexkingdom
Copy link
Author

@xyNNN I will try to explain, think about situation when someone buy a ticket from your site.
How it's look like:

  1. Click button buy
  2. Post request to payment endpoint (not ajax)
  3. We make all checks if user have enough money
  4. In case of success of point 3, we set data layer something like: $googleTagManager->addPush(['purchase' => 'ticket', 'amount' => 125.50]);
  5. Redirect to success page

And on success page we don't have this data layer with these data.
Hope you understood me.
Below you will find just small piece of code.

image

@xyNNN
Copy link
Owner

xyNNN commented Oct 11, 2021

Sorry @alexkingdom for this delay. Currently I'm very busy myself and don't find time to investigate your issue.
Perhaps you could please debug it yourself to identify your problem and that I'm willed to help you to merge this pull request ASAP and create a new bugfix release for you!

@alexkingdom
Copy link
Author

Will make more deep investigation but later. Now too busy :(

@kristjan-kure
Copy link

@alexkingdom - Do you mean GA4 purchase event with attributes: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#make_a_purchase_or_issue_a_refund should be triggered on success page?

@stefandoorn
Copy link
Collaborator

@alexkingdom I think it makes more sense that you make sure the right attributes are injected into GTM on the actual success page. I don't think this library should persist things to a next pageview as everyone's use case is different.

E.g. I do similar to you on the confirmation page in a project. I store the Order ID in the session, then I use that Order ID on the success page to pull the data I need, clear the session and inject it into GTM.

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

No branches or pull requests

4 participants