Skip Navigation

[Resolved] Google Maps cookie consent form

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by umbertoZ 1 year, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2574143

Hi, I've set up a Google Maps cookie consent form. I followed this topic:

https://toolset.com/forums/topic/toolset-maps-and-gdpr-cookie-consent-plugin-seems-to-conflict/#post-1326825

I did my personal version. I use Beda's JS code to set the cookie and then I've built a custom shortcode to check if the cookie is set. It works fine.

My problem is that WP Fastest Cache is caching the page before I click the consent button (that stores the cookie). When the page is reloaded on consent click, the cookie is corretly stored, but the browser loads the cached version of the page and it still displays the consent form instead of the map.

If I open other pages with maps, they are correctly displayed, because the cheking cookie shortcode works fine. But if I go back to the first page where I clicked the consent button, I still get the button instead of the map.

Is there a way to load all the Map code on the page (so it would be cached), but not activate it (so it doesn't store any cookie and it doesn't display the map) untill I click the consent button?

cheers

#2574813

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The solution provided by Beda was using the custom code and thats not the official Toolset feature. Also we do not have extensive exposer about how " WP Fastest Cache " plugin cache works. The question you raise here you should actually ask to " WP Fastest Cache " plugin support and I believe they will guide you better in this matter.


My problem is that WP Fastest Cache is caching the page before I click the consent button (that stores the cookie). When the page is reloaded on consent click, the cookie is corretly stored, but the browser loads the cached version of the page and it still displays the consent form instead of the map.

If I open other pages with maps, they are correctly displayed, because the cheking cookie shortcode works fine. But if I go back to the first page where I clicked the consent button, I still get the button instead of the map.

==>
As the plugin WP Fastest Cache is caching the page before you click the consent button would you mind to check with the "WP Fastest Cache" plugin support and check with then if they offer any hook or filter that you can use to solve your problem.

#2574983

Hi Minesh, thanks for your answer. I'm going to contact Fasters Cache support, but what I read in their documentation is that it is possible to exclude elements by URL, so I could only exclude pages with maps from caching. This is 80% of my pages, so it is like I deactivate caching.

I found that I could exclude a JS script from caching in this way:

<script language="javascript" type="text/javascript" data-wpfc-render="false">
</script>

Is there a way to load the [wpv-map-render] shortcode from a JS script?

cheers

#2575031

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I do not have any other way to offer the Toolset map using the custom JS:

Here is the official Maps javascript API but the hooks are offered after map is loaded on map and is on map load complete event:
=> https://toolset.com/documentation/programmer-reference/maps/programmatically-change-map-settings/

There is map reload and init events. I see you already using it and here is the reference ticket of yours:
- https://toolset.com/forums/topic/google-map-in-bootstrap-accordion-in-a-cred-form-or-view/#post-406037

But there is no way to render the map using the JS as of now.

#2575037

My issue is resolved now.

I found Cache flush Hooks on WP Fastest Cache documentation:

hidden link

Thank you!