Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32703
    Chris
    Guest

    Hi Guys,

    I’m having a bit of a strange issue using the following plugins together:

    – W3 Total Cache
    – Gravity Forms
    – HandL UTM Grabber

    I’m using UTM parameters to track click throughs from partner sites, so an example link might be…

    https://example.com/?utm_source=partner1&utm_medium=web&utm_campaign=partnercampaign

    UTM Grabber grabs these parameters, and stores them in a cookie.

    When somebody completes one of my gravity forms, the form should pick up the cookie value in a hidden field and pass it through.

    What’s actually happening is that those cookie values are being cached on the server somewhere, and the hidden form values are pre-filled with the incorrect value. So basically, I’ll get a bunch of completions with the same UTM parameters, even though I know they didn’t come from the same source (tested this by sending the above URL to a friend with different UTM values. When they complete, I get the same UTM values that I got).

    Disabling W3TC fixes this issue, so I’m fairly confident that it’s a caching issue. Unfortunately, W3TC is great for the performance of my site, so I’m reluctant to keep it switched off.

    Is there a way to have W3 NOT cache the values for my gravity forms only?

    The form in question is here:
    https://example.com/contact/

    I’ve considered just preventing caching on that page, but I have quite a few gravity forms throughout the site and reluctant to switch caching off for all of those pages.

    To recreate the issue, just click on the first link here (maybe tweak the params first to make them unique):
    https://example.com/?utm_source=partner1&utm_medium=web&utm_campaign=partnercampaign

    Then click on the contact link. If you inspect the form’s hidden fields, you’ll see the wrong values.

    Any ideas?

    Thanks

    #32712
    Jesse Owens
    Keymaster

    Hi Chris-

    The first thing to check is the Cache URIs with query string values setting in Performance > Page Cache. Make sure that isn’t checked and purge your caches.

    Another possibility might be to create a Cookie Group for that UTM Grabber Cookie you mentioned. Enable the group, and make sure the Cache option is checked for that. *Edit- the cache option should be checked for this.

    • This reply was modified 3 years, 3 months ago by Jesse Owens. Reason: Additional information from MarkoV
    #32713
    Chris
    Guest

    Thanks for your response Jesse.

    I’d actually already checked both of those things.

    Cache URIs with query string variables = already unchecked.

    In terms of the Cookie Group, I also gave that a go. Does this configuration look correct to you? It didn’t resolve my issue unfortunately:

    I’ve created a new cookie group, Group Name “utm_grabber”.

    Enabled = true/ticket
    Cache = false/unticked

    Cookies:
    handl_landing_page
    handl_original_ref
    handl_ref
    handl_url
    utm_campaign
    utm_content
    utm_medium
    utm_source
    utm_term

    #32716
    Marko Vasiljevic
    Keymaster

    Hello Chris,

    Thank you for the information provided.
    As I’ve already answered you in wp.org and this a duplicate post please make sure to check the wp.org topic:
    https://wordpress.org/support/topic/prevent-caching-with-gravityforms/#post-13868293

    For your convenience this was my reply:

    You should use the correct groups and each group should specify {key}={value}
    Depending on what key you are using, that should look like {key}='{“strict”:”1″,”thirdparty”:”0″,”advanced”:”0″}’
    So you should replace {key} with the actual cookie name.

    And don’t forget to enable all the checkboxes (enable and cache)
    Once again as the cookies are cached and may change depending on a value, you should exclude those pages from being cached to avoid this.
    This is simply how cache works. I hope this helps!
    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Gravity Forms – caching form values?’ is closed to new replies.