Image

Cookie Bricks

설명

Cookie Bricks allows you to create dynamic tags in Bricks Builder that fetch cookie values.
Perfect for personalization based on user behavior or preferences stored in cookies.

스크린샷

  • Image
    Example of how to insert a cookie value into a text field.
  • Image
    Example of conditional display based on cookie value.
  • Image
    Example of a dynamic URL created with a cookie value.
  • Image
    Example of how to insert a cookie value into a code block.

설치

  1. Upload the cookie-bricks.zip folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the “Plugins” menu in WordPress.
  3. Use the dynamic tag {get_cookie_value:cookie_name} in Bricks Builder.

FAQ

How do I use the plugin?

Simply use the dynamic tag {get_cookie_value:cookie_name} in Bricks Builder, replacing cookie_name with the key of your desired cookie.

You can insert it in any field that supports dynamic tags, such as Heading, Text elements (basic, rich and variants), conditions, custom URLs, code blocks, etc.

For example, to obtain the value of a cookie named "liked_posts", write {get_cookie_value:liked_posts}.

Why not simply use values in custom fields (ACF, Metabox…) ?

Custom fields are very useful for storing manually entered values. But sometimes you need to use values that are dynamically generated according to user behavior, automatically calculated, or retrieved from other sources. This is where cookies come in.

Examples of use :
Recently consulted articles or products, date of last visit, time spent on a page, last page visited, filter parameters applied to a search, last step completed in a form, last button clicked, choice of theme (dark/light), and many others.

For each of these situations, it’s possible to use the value directly in a text field, or to use it for conditional display (e.g. for A/B testing).

What happens if the cookie doesn’t exist?

The tag will return “Cookie not found” by default.

How do I check the value of a cookie?

On your page, open the browser console with F12 (or CTRL+SHIFT+I), go to the “Applications” tab –> “Cookies” –> yourwebsite.com

⚠️ Currently, Cookie Bricks 1.0 can read the value of a cookie, but cannot create it. Make sure that the cookies you want to retrieve exist in the browser.

후기

Image
2025년 7월 7일 답글 1개
This plugin appears to work exactly as it says it does. It’s tiny. Barely 100 lines of code. Thank goodness, it *only* exposes cookies as an option for element conditions. You are responsible for creating the cookies via some other mechanism. THANK YOU for making this plugin, it’s precisely what I needed and appears to works exactly as I hoped it would. Given how tiny and lightweight this is, I’m really surprised that it’s not just built in Bricks by default.
Image
2025년 3월 1일 답글 1개
Thanks for making this useful plugin. Works perfectly. I have used it in Bricks element conditions, to show and hide content based on whether the cookie is there or not. Your plugin made that super easy to do. Thanks!
모든 2 평가 읽기

기여자 & 개발자

“Cookie Bricks”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Cookie Bricks”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

See changelog.txt for details.