DEAL ENDS IN:

WINTER SALE!

UP TO 35% OFF!

GET IT NOW

Dynamic Content From CSV

Create and manage thousands of dynamic content versions directly from a CSV file.


Why should I use Dynamic Content from CSV?

Creating dynamic content using an If-So trigger is super easy and useful. But if you’re applying thousands or even only dozens of dynamic versions, it can become time-consuming, and the page-load delay becomes noticeable.

The If-So Dynamic Content From CSV extension is a new way to easily create and manage your dynamic content. It allows you to create and manage thousands of dynamic content versions directly from…well…a CSV file.

If-So Dynamic Content From CSV is flexible enough to suit any need and syncs with If-So.  Its functionality includes:

  • Compatibility with HTML as the CSV content
  • Can be used with page caching 
  • Displays content that can be used anywhere on your site or on your page templates

Which Conditions Can You Set with If-So CSV?

  1. Query-String (URL Parameter): Show content based on the value of a parameter
  2. Geolocation: Show dynamic content based on the country, state, or city name
  3. User Time zone
  4. Date/time
  5. Page URL
  6. Post ID
  7. User IP
  8. User Details (email / user name)
  9. Referral Source
  10. Custom User Profile Field (requires the extension)

If you want to show dynamic content based on other If-So conditions, feel free to check out our dynamic triggers.

How to set up Dynamic Content from CSV?

A single CSV table of dynamic content is called a “Bulk”. The example below explains how to set a bulk with a query-string condition. The same principle applies to the rest of the conditions.

Step1: Create a CSV file with the following structure:

  1. Column A – the values of the condition. One value per row. The table below shows the required values for each condition.
Condition Values in column A Example
Query StringThe value of the query parameter – value only, without apostrophes.If the name of the parameter you had set when you created the trigger was “example”, and you’d like to display content when the page URL contains the query ?example=”value1″, then the value in column A should be value1
GeolocationThe value changes depending on the level (country, state, city, continent). Learn more.
Page URLThe Page URL, including the protocol (http:// or https:/), including www, and including / (slash) at the end of the URL.To display dynamic content on the current page, the value should be:
https://www.if-so.com/dynamic-content-from-csv/
Post IDThe post ID (how to get the post ID)
User IPThe user IP
Date/ timeThe date and time according to the format selected when you create the bulk.
Cookie / Session Variable ValueCookie – the cookie value
Session – the session variable value.
User DataUsername – The username as it appears in the user profile.

Email – The user email as it appears in the user profile.
Referral SourceThe referral page URL, without http:// or https://, without www, and without a / (slash) at the end of the URL.
Custom User Profile FieldThe Meta Field key (name)


Default content – Default content is the content that will be displayed if the condition is not met. To set up a row of default content, select one of the rows and set column A with the value “default content”.

  1. Columns B: the dynamic content that will be displayed if the URL contains the parameter value (can be HTML if you want).
  2. Column C-F (optional): columns C-F are additional columns you can use to display dynamic versions in other places on your page.

After uploading the CSV to your site, you will receive unique shortcodes which correspond to the content of each column.

Download a template file

Step 2: Upload your CSV

  1. On your WP dashboard, go to If-So > Bulks
  2. Click “Add a new bulk”
  3. Name your Bulk (the name is for your reference only)
  4. Under “Condition Type”, select “Query String”
  5. Set your parameter (the parameter is the bolded part in the following example:  www.example.com?color=red). The parameter can be whatever you want, except for several WordPress reserved terms.
  6. Select your CSV separator – by default, the separator should be “Comma”. If your content contains commas you might want to set a different separator when you save your file. 
  7. Upload your file.
  8. Click “Create Bulk”.

Displaying your dynamic content

  1. The bulk you created in the previous step should now be shown on the If-So > Bulks page. Find it and click “View”.
  2. Copy the shortcode of the content (column) you want to display.
  3. Paste the shortcode anywhere on your website.

Loading the dynamic content from CSV using Ajax

If you are using cache on your site (particularly page cache), you can load the dynamic content using a separate Ajax request that will take place after the static content loads from the cache. This way, you can use dynamic content while continuing to enjoy the advantages of caching.

The If-So Dynamic Content From CSV extension relies on the default Ajax Loading settings of the core If-So plugin. However, if you want to override those settings, you can simply add the parameter ajax=”yes” or ajax=”no” to the CSV shortcode. For example:

[ifso_bulks id='1' column='B' ajax='yes']

Learn more about the Ajax Loading (Page Caching Compatibility) option

Embedding the Shortcode in a Page Template

If necessary, you can embed the CSV shortcode directly in your theme files. Just apply the shortcode using the ‘do_shortcode’ function. Here’s an example:

<?php echo do_shortcode('[ifso id="XXX" ajax="yes"]');?>

Configuring “Recurrence” for a consistent content experience

The recurrence option enables you to ensure the consistency of a user’s experience. Once a user has visited the website and seen a certain dynamic version, the same version will be displayed every time they encounter the dynamic trigger.

Recurrence settings are managed at the “bulk” level, either during the creation of the bulk or through the bulk settings after its creation.

Troubleshooting

  • Content in columns A is broken after uploading a CSV file or saving a bulk

    By default, the number of allowed characters in a single cell in column A is 55. This limitation is intentional to optimize the loading speed of the dynamic content for users who don’t need a higher number of characters.

    To change the max allowed number of characters in column A:

    1. Add the code below to your functions.php file.
    2. Visit one of your website pages (it will run the code).
    3. Remove the code from your functions.php file.
    function modify_content_column(){
        global $wpdb;
        $wpdb->query("ALTER TABLE {$wpdb->prefix}ifso_bulks_content MODIFY COLUMN version VARCHAR(100);");
    }
    add_action('init','modify_content_column');
    

    The code above will change the number of allowed characters to 100. You can replace the number in the code with any other number. Bear in mind that if your file consists of many dynamic versions (thousands), there might be some loading speed implications (they will probably be insignificant, but it is worth checking).

    Please note that if you reduce the number of allowed characters, the new number you set will affect content created in the past.

  • Content is broken after uploading a CSV file or saving a bulk (in any column except column A)

    By default, the number of allowed characters in a single cell (except column A) is 1024. This limitation is intentional to optimize the loading speed of the dynamic content for users who don’t need a higher number of characters.

    To change the max allowed number of characters in the relevant column:

    1. Add the code below to your functions.php file.
    2. Visit one of your website pages (it will run the code).
    3. Remove the code from your functions.php file.
    function modify_content_column(){
    global $wpdb;
    $wpdb->query("ALTER TABLE {$wpdb->prefix}ifso_bulks_content MODIFY COLUMN content VARCHAR(2048);");
    }
    
    add_action('init','modify_content_column');
    

    The code above will change the number of allowed characters to 2,048. You can replace the number in the code with any other number. Bear in mind that if your file consists of many dynamic versions (thousands), there might be some loading speed implications (they will probably be insignificant, but it is worth checking).

    Please note that if you reduce the number of allowed characters, the new number you set will affect content created in the past.

  • Was this Helpful ?
  • YesNo

Included in our all access

WINTER SALE!

Dynamic Content From CSV


$49

30-day money back guarantee.
You are 100% safe!