DEAL ENDS IN:

SUMMER SALE!

UP TO 40% OFF!

GET IT NOW

3 Ways to Display Dynamic Content Based on the Page URL

If you're using If-So and want to display different content based on the page URL, there are three flexible methods you can use - each suited to different use cases.
wordpress notification bar

If-So offers three methods to display dynamic content based on the page URL:

  1. Trigger with a “Page URL contains” condition – best for targeting groups of pages with similar URL structure.
  2. Query string values using Dynamic Keyword Insertion (DKI) – perfect for injecting specific values into the page based on URL parameters.
  3. CSV file with exact URL matches using the Bulk extension – ideal for managing a large number of predefined URLs efficiently

1. Triggers with a “Page URL” Condition

If-So triggers allow you to set conditions based on whether the page URL contains a specific string. This is especially useful when you want to display content only on pages that include certain keywords or structures.

Using the “URL Contains” Option to Display Dynamic Content Based on Query Strings (Parameters)

Another useful option is to display content based on any custom parameter added to the page URL. The page itself remains unchanged – only the content being displayed adjusts based on the presence or value of the parameter. For example, you could add ?audience=students when sharing a link via SMS or an email campaign, and show a custom message if the URL contains that parameter.

Use Case Example:
Display a promotion banner on all product pages where the URL contains /shoes.

How to set it up:

  • Create a new If-So trigger.
  • Under the condition type, choose “Page URL Contains”.
  • Enter the relevant part of the URL (e.g., /shoes).
  • Add the content you want to display.

Advantage: This method offers maximum flexibility. It supports setting up dynamic content based on whether the URL contains a specific keyword or phrase.

Consider using CSV instead if: You need to manage a large number of predefined URLs efficiently and can work with exact URL matches only.

Consider using DKI instead if: You only need to insert specific values into the content based on URL parameters, without managing multiple content versions.

Learn more about the Page URL > Contains condition

2. Dynamic Keyword Insertion (DKI) via Query String

This method is perfect when the dynamic content you want to show matches a value in the URL’s query string (e.g., ?_name=Sarah).

Watch it in action

The example below shows the usage of the Query-string DKI shortcode to display the value of the parameter “example”. As fallback content, if the parameter doesn’t exist in the URL, we display the value {YOUR NAME}. You can choose any other value or leave the fallback blank if you don’t want to display any fallback value.

👑 {YOUR NAME} is awesome!👑

livedemocharacter Fill in your name to see it in action

How it works:

Simply insert the following shortcode where you want the value to appear:

[ifsoDKI type="querystring" parameter="_name"]

This method doesn’t require creating multiple versions. The shortcode simply pulls the value from the URL.

Learn more about the query string DKI

3. Dynamic Content from CSV (Bulk Extension)

If you’re working with hundreds or thousands of URL-based content variations, the CSV (bulk) method is the most efficient option. You upload a CSV file where each row defines a condition and the matching content version.

Use Case Example:
Show a state-specific promotion on URLs like /store/california, /store/texas, /store/florida, etc.

How it works:

  • Create a CSV file with two columns: one for the exact page URL, and one for the content.
  • Import it using If-So’s bulk extension.

The bulk extension is designed for speed and scale – that’s why it doesn’t support “URL contains” logic. It only matches exact URLs for optimal performance.

Learn more about the CSV (bulk) method

Combine Methods for Maximum Flexibility

You don’t have to choose just one method—you can mix and match depending on your setup. For example:

  • Insert a query string shortcode inside a trigger or bulk version.
  • Use triggers to show or hide content blocks that include DKI shortcodes.

This gives you the freedom to scale personalization while keeping performance in check.

Summary: Which Method Should You Use?

MethodBest ForSupports “URL Contains”?Scalable?
Trigger (Page URL)Flexible targeting on specific page patterns✅ Yes⚠️ Limited with many versions
CSV (Bulk)High-volume dynamic content by exact URL match❌ No✅ Very efficient
Query String DKIInserting single dynamic values into contentN/A (based on query)✅ High-performance
Related Articles