Do you want to add code snippets to your website with unprecedented precision?
You now have the ability to use query parameters in Page URL Conditional Logic to target specific pages of your website more precisely. This new feature lets you insert code snippets into areas never possible before!
Also, the Conditional Logic picker has got a new look so you can find and select the appropriate rule more easily and quickly.
Let’s learn all about these exciting updates in WPCode v2.2.0!
Introducing Query Parameters In Conditional Logic
Using WPCode, you can already insert code snippets to any page of your website using the Conditional Logic rule: Page URL. We are taking this feature to the next level. From now on, you will be able to add code snippets in posts/pages when certain conditions are met using query parameters.
Query parameters modify the content or behaviour of a web page by passing additional information in the URL. For example, while “https://example.com/products
” shows all the products of an eCommerce website, “https://example.com/products/?type=laptop&brand=Apple
” only shows Apple laptops.
Now that WPCode supports query parameters, you can add multiple code snippets to the same page based on specific scenarios. For instance, you can show different banners to visitors from different campaigns. What’s more, you can use this feature not only on the front end but also on the back end admin area using the Admin Header and Admin Footer locations.
How To Use Query Parameters In Conditional Logic?
Since query parameters are a form of URLs, you can configure them similarly to how you set up the Page URL Conditional Logic rules. Here’s a step-by-step guide to setting it up:
- Create Your Code Snippet: Begin by creating a new code snippet or editing an existing one.
- Navigate to Smart Conditional Logic: Scroll down to the “Smart Conditional Logic” section in your snippet editor.
- Enable Conditional Logic: Toggle on the “Enable Logic” option.
- Configure the Condition: Based on your requirement, decide whether you want to “Show” or “Hide” the snippet.
- Select Page URL: From the dropdown menu, choose “Page URL” as your condition type.
- Set URL Match Type: Select how the URL should match from options such as “Is/Is Not/Contains/Doesn’t Contain.”
- Enter the URL with Query Parameters: Write/paste the URL that includes the query parameters into the designated field.
![Conditional Logic Just Got A New Look With Added Functionality In WPCode v2.2.0: How to add query param in Page URL](https://wpcode.com/wp-content/uploads/2024/07/add-query-parameter.jpg)
Conditional Logic Picker Got A New Look!
We’ve redesigned the Conditional Logic picker to enhance usability and efficiency. Conditional Logic rules are now categorized into four distinct groups, allowing you to locate the specific logic you need more easily. Additionally, the search box eliminates the need to browse through all available rules. Simply type in what you’re looking for and select the desired conditional logic directly.
![Conditional Logic Just Got A New Look With Added Functionality In WPCode v2.2.0: Redesigned Conditional Logic](https://wpcode.com/wp-content/uploads/2024/07/conditional-logic-picker.jpg)
Closing Notes
We have introduced these new enhancements so you can add code snippets to your website more precisely. We believe the support for query parameters and the redesigned Conditional Logic picker, will significantly elevate your website customization ability and help you stay ahead of your competitors.
Upgrade to WPCode Pro now to customize your website like never before!