Works with your stack
Cookie consent for the Cocoon theme
click statistics in the theme
Cocoon is a WordPress theme with click analytics of its own, on by default. Its script records clicks on your pages, keeps a visit ID in session storage and sends the clicks to your own site. Cookie Rocks holds it until the visitor accepts statistics. Its share buttons can also load Pinterest.
By Cocoon · wp-cocoon.com
Is this your product? Tell us if anything here is out of date. Write to us
What matters for consent with Cocoon
A visit ID in session storage
cocoon_click_analytics_session holds the visit ID, and cocoon_click_analytics_session_time the time of the last click. After 30 minutes without a click, a new visit starts.
Its own consent switch
The click script starts at once by default and respects Global Privacy Control and Do Not Track. A developer filter, cocoon_click_analytics_initial_consent, can make it wait, and its setConsent switch stops it and clears its keys. Neither is a setting in the theme’s screens.
Pinterest share button
With its default share buttons, Cocoon loads Pinterest’s pinit script, which contacts log.pinterest.com and sets a cookie on pinterest.com. In our test, Cookie Rocks held it until Accept all.
Cookie Rocks today
Since Cookie Rocks 2.11.9, the click analytics script is held until the visitor accepts statistics: in our test, no click was sent to your site and no cocoon_click_analytics key was written before the choice or after Reject all, real clicks included. After Accept all it ran without a reload. The Cookie Rocks scan names Cocoon as the source of its keys and proposes statistics. Cookie Rocks does not need the theme’s setConsent switch for this.
What our tests found on Cocoon
Good to know · CocoonCocoon's click analytics has a consent filter and a consent call
A filter and setConsent() let a consent tool start click analytics; check that setConsent exists first.
Confirmed by the developer, 19 November 2026, Cocoon. Source: Developer's answer, GitHub xserver-inc/cocoon issue 428 (19/11/2026): https://github.com/xserver-inc/cocoon/issues/428
Full detail
Cocoon's developer describes the filter cocoon_click_analytics_initial_consent and window.CocoonClickAnalytics.setConsent() as its integration points for consent: return false from the filter, then call setConsent(true) after the visitor accepts, which also works with page caching. They are not a formal public contract between versions, so a consent tool should check that setConsent exists before calling it. The theme has no plan to support the WP Consent API for now.
Before the choice · CocoonCookie Rocks holds Cocoon's click analytics until statistics consent
No click recorded before statistics consent.
Seen in our tests, 18 November 2026, Cocoon 2.9.6.3.
Full detail
Cookie Rocks 2.11.9 holds the Cocoon theme's click analytics script: before the choice and after Reject all, no click was sent to the site's click-events address and no cocoon_click_analytics key was written, real clicks included. After Accept all the script ran without a reload and sent the clicks.
A setting to know · CocoonCocoon's click analytics is on by default and sends to your own site
setting “Click analytics” · by default: on
Clicks go to your own site from the first page; keys erased only once classified.
Seen in our tests, 17 November 2026, Cocoon 2.9.6.3.
Full detail
Cocoon's click analytics starts at once on a default install, keeps cocoon_click_analytics_session and cocoon_click_analytics_session_time in session storage, and sends clicks to the site's own REST address (cocoon/v1/click-events). It respects Do Not Track and Global Privacy Control. A developer filter, cocoon_click_analytics_initial_consent, can make it wait, and window.CocoonClickAnalytics.setConsent(false) stops it and clears its keys. Cookie Rocks 2.11.8 does not hold the script; once the admin classes the keys as statistics, it erases them until consent, but the clicks are still sent to the site.
WordPress themes
Other plugins of the same kind.
Questions
What happens after the 30-day trial?
The banner, your visitors’ choices and your proofs of consent keep working. Without a key, most settings lock, updates and support stop. Take a key at any time and everything opens again.
For Cocoon sites
Keep your theme, add consent.
click statistics in the theme
Every feature of the complete plugin for 30 days, no card. Cocoon keeps working as it does today.
- During the trial: everything, including the full settings and the scans
- After 30 days without a key: the banner, your visitors’ choices and your proofs of consent keep working
- What waits for a key: most settings, updates and support

Get your trial key
Your e-mail and your site. Your key arrives as soon as you confirm your e-mail.