magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

The Varnish configs do not strip Klaviyo marketing parameter

Open Gelmo opened this issue 2 years ago • 23 comments

Preconditions (*)

  1. Any Magento version that includes a suggested Varnish VCL config.
  2. Using Varnish along with a VCL that is included with Magento.
  3. Usage of Klaviyo's marketing email services/modules.

Steps to reproduce (*)

  1. Use a VCL that is included with Magento.
  2. Send a marketing email via Klaviyo.
  3. Watch varnishlog.
  4. Visit the site using a link that is included in a Klaviyo-generated email.
  5. Visit the site using a similar link that does not include the _kx query parameter.
  6. Compare the results shown by varnishlog.

Expected result (*)

  1. The _kx parameter should be stripped, ensuring that visitors using links with the _kx parameter are served the cached version of the requested page.

Actual result (*)

  1. Varnish does not strip the parameter, and since the value is unique per visitor, those requests will not match any hashes in Varnish's cache.
  2. This also results in additional PHP load due to the request needing to be processed by Magento.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [X] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Gelmo avatar Mar 24 '22 23:03 Gelmo

Hi @Gelmo. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Mar 24 '22 23:03 m2-assistant[bot]

@magento I am working on this

Gelmo avatar Mar 24 '22 23:03 Gelmo

Hi @Gelmo! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

m2-assistant[bot] avatar Mar 24 '22 23:03 m2-assistant[bot]

@magento add to contributors team

Gelmo avatar Mar 25 '22 00:03 Gelmo

Hi @Gelmo! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

m2-assistant[bot] avatar Mar 25 '22 00:03 m2-assistant[bot]

@magento I am working on this

Gelmo avatar Mar 25 '22 00:03 Gelmo

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

m2-assistant[bot] avatar Nov 07 '22 01:11 m2-assistant[bot]

Hi @Gelmo ,

We are trying to reproduce the issue in 2.4-develop instance but we are not able to reproduce. Steps We followed: 1.Install mAgento 2.Done Varnish Setup Configuration 3.Install Klaviyos Module 4.Integrate with magento from klaviyos 5.we are not able to integrate the module

Screenshots: Screenshot 2022-11-04 at 4 34 16 PM

Still we are working in this module to reproduce the issue...we will reproduce the issue ASAP.

Let us know if we missing anything!!! Thanks!!!

engcom-Dash avatar Nov 07 '22 01:11 engcom-Dash

@engcom-Dash Hello! How to move this issue from the ground? Can it be assigned to me to complete the rest of the required steps?

vasileuskidzmitry avatar Nov 18 '23 09:11 vasileuskidzmitry

@magento I'm working on this

vasileuskidzmitry avatar Nov 20 '23 10:11 vasileuskidzmitry

Hi @vasileuskidzmitry! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

m2-assistant[bot] avatar Nov 20 '23 10:11 m2-assistant[bot]

@magento add to contributors team

vasileuskidzmitry avatar Nov 20 '23 10:11 vasileuskidzmitry

Hi @vasileuskidzmitry! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

m2-assistant[bot] avatar Nov 20 '23 10:11 m2-assistant[bot]

@magento I'm working on this

vasileuskidzmitry avatar Nov 20 '23 10:11 vasileuskidzmitry

I'm unable to edit the original comments to update steps so I will add them here.

Steps to reproduce (*)

  1. Use a VCL that is included with Magento.
  2. Read this article as confirmation that _kx parameter belongs to Klaviyo marketing campaigns - https://help.klaviyo.com/hc/en-us/articles/115005076767.
  3. Switch Magento/Adobe Commerce to developer mode so the X-Magento-Cache-Debug header is included in the response.
  4. Visit any page (for instance the Home one) twice. Check that X-Magento-Cache-Debug contains HIT value to confirm that the page is cached by Varnish.
  5. Now add _kx parameter with some random unique value (Ex. https://yourdomain/?_kx=1) to the URL and visit it.

Expected Result

  1. When you visit the URL form point 5, you see HIT value in the X-Magento-Cache-Debug, because _kx is a marketing parameter that should be omitted.
  2. Every time you change _kx to some new value, you see HIT anyway.

Actual Result

  1. You see MISS in that header.
  2. Every time you change _kx to some new value, you see MISS anyway. A new cache entity is created in Varnish on every such request.

vasileuskidzmitry avatar Nov 20 '23 15:11 vasileuskidzmitry

cc @engcom-Dash

vasileuskidzmitry avatar Nov 20 '23 21:11 vasileuskidzmitry

Added new PR

vasileuskidzmitry avatar Nov 26 '23 17:11 vasileuskidzmitry

cc @engcom-Bravo

vasileuskidzmitry avatar Nov 30 '23 09:11 vasileuskidzmitry

I updated priority to p2, to make it similar to https://github.com/magento/magento2/pull/38302#event-11314093429

ihor-sviziev avatar Jan 03 '24 14:01 ihor-sviziev

@ihor-sviziev Here is one another marketing system https://www.northbeam.io/ that uses its own marketing parameters (starting with "nb_"). Should I create a separate issue/PR for this or it could be done here or in #38302 ?

vasileuskidzmitry avatar Jan 05 '24 16:01 vasileuskidzmitry

@vasileuskidzmitry I don't mind about any of these options.

ihor-sviziev avatar Jan 08 '24 13:01 ihor-sviziev