Deal ends in:

SUMMER SALE! UP TO 40% OFF!
GET IT NOW watermelon

How to Insert a Contact’s Name From your CRM/ESP into your Site?

Using data from your Customer Relationship Management (CRM) or Email Service Provider (ESP)  is a great way to personalize a user’s experience on your site. The user’s name or any other data can be automatically included as a query parameter in the URL, and be displayed on your website using a simple shortcode.

livedemocharacterLive Example: Click here to See how we display the name “Bob” on our website’s main banner.

What kind of information can I use?

CRMs and ESPs can store lots of information about your users, such as name, email, location, and even preferences they may have filled out on a form on your site. All this data can be added to links created by these systems as a value of a query parameter. In most CRM’s and ESP’s, these parameters are usually called “Merge Tags”. 

Merge Tags

CRMs and ESPs use “merge tags” to correspond with fields and information from your database. These “merge tags” are the format for the query string parameter. 

For example, if you are using the “User Name” merge tag, the user’s name will automatically be added to the links from your email campaign to your website (i.e example.com?firstname=Bob).

How to display a name (or any other data) on your site using a shortcode

Once you have the user name, or any other value, as a parameter in the URL, you can use our query string DKI shortcode to automatically display that parameter value on your page. 

The shortcode will display the value of any parameter of your choice. Simply, paste the following shortcode on your site and replace the parameter name with your own parameter name.

Default value - optional

For example, the shortcode below will display the value of the parameter example

Setting up a fallback

By default, the query string DKI shortcode will not display anything if the parameter doesn’t exist in the URL. If you want to set a different value, simply add the parameter fallback=”your value” to the shortcode, and set its value.

your value - optional

Displaying values of more than one query parameter

You can use the Query string DKI shortcode numerous times on the same page. All you have to do is to add a shortcode for each one of the parameters.

Passing multiple parameters in the URL is done by separating each parameter with an & sign.

i.e. example.com?param1=value1&param2=value&param3=value3

If you want to display the output of the query-string DKI shortcode when users browse other pages on your site, add the parameter persist=”yes” to the DKI shortcode. Learn more.

Tags used by common CRMs and ESPs

For your convenience, here is a list of tags used by common CRMs and ESPs:

  • MailChimp’s merge tags: |TAG| (e.g. |FIRSTNAME|). Learn More.
  • ActiveCampaign’s merge tags: %TAG% (e.g. %FIRSTNAME%). Learn more.
  • Drip’s merge tags: {{ tag }} (e.g. {{ firstname }}.
  • ConvertKit’s merge tags: {{ tag }} (e.g. {{ subscriber.first_name }}). Learn More.
  • HubSpot’s merge tags: {$tag} (e.g. {$FirstName}). Learn More.
  • Salesforce’s merge tags: {!ObjectName.FieldName} (e.g. {!Contact.FirstName}).
  • AWeber’s merge tags: {!tag} (e.g. {!firstname}).
  • Bronto’s merge tags: %%tag%% (e.g. %%firstname%%).

Reserved WordPress Terms (parameters)

WordPress reserves some parameters for its own use. Adding these parameters to the URL may result in a 404 error without any other hint or explanation. 

Click here for the full list of reserved term

Geolocation DKI (Dynamic Keyword Insertion)

Demo

People in California love If-So!

Your location name in the above example is displayed using the Geolocation DKI Shortcode. Your location is detected using our IP-to-location service.

Geolocation DKI shortcodes

Applying the geolocation shortcode is as simple as generating it with the generator below and pasting it on your site.

The shortcode below was used to create the demo at the top of this page. It includes all available attributes:

[ifsoDKI type="geo" show="country" ajax="yes" fallback="your country" before="users in" after="love If-So!"]

You can use the shortcode in any field that accepts shortcodes, or include it via a simple PHP line in your theme files.

Available shortcode attributes

  • show – Choose the type of location you want to display: continent, country, state, city, or time zone.
  • ajax (optional) – Set to yes if your site uses caching. The location name will be loaded in a separate AJAX request after the cached content finishes loading.
  • fallback (optional) – By default, the Geolocation DKI shortcode does not display anything if no value is returned by the IP-to-location database (typically when sessions are exhausted or, in rare cases, when the user’s IP is not recognized). Set this parameter to display an alternative value.
  • before / after (optional) – Text to display before and/or after the location name. Alternatively, place the shortcode in the middle of a sentence.

Geolocation DKI shortcode builder

Customize the fields to generate your shortcode, then copy and paste it wherever you want the dynamic value to appear.

Set ajax to “yes” if your site uses caching.
Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).

Your Shortcode

Paste the shortcode wherever you want the dynamic value to appear.

City-level accuracy notice

IP-to-location services (all providers, not just If-So) are not 100% accurate. Accuracy is generally high at the country and state levels, but it becomes more variable at the city level.

If you use the city-level Geolocation DKI shortcode, consider enabling our HTML5 Geolocation API or offering a manual self-selection option. The first approach improves accuracy, while the second lets users correct their location when needed.

FAQs

  • Can the Geolocation DKI Shortcode display location names in other languages?

    The DKI shortcode retrieves values directly from our IP-to-location database and is limited to displaying location names in English. However, our CSV extension offers a solution:

    1. Ensure the CSV extension is installed on your site.
    2. Download our “All-countries” CSV file (click to download).
    3. Insert the desired language’s location names in column D.
    4. On your WP dashboard, create a new bulk with a geolocation condition and upload the file.
    5. Paste the CSV shortcode, displaying values from column D, wherever you want to show the country name on your page.

Dynamic Keyword Insertion

With If-So DKI you can display:

  • The user’s location: country, state, city, or continent
  • A value of a query string parameter
  • The user name
  • An event time – calculated according to the user time zone

And more…

The Available DKI Shortcodes

Geolocation DKI

Display the user’s location: country, city, state, continent, or time zone.

Google Ads DKI

Insert the keyword that was used to trigger your ad.

Query String DKI

Display the value of any query string.

Auto-Local Time Display

Show an event time that is calculated according to the user’s time zone.

User Details (for logged-in users)

Display the user’s first name, last name, email, and more.

Display a login/logout link.

Browser Language DKI

Display the user’s browser language.

Referral Source DKI

Display the URL of the referral website or webpage.

Post ID

Display any page, post, or custom post using a simple shortcode.

Number of Pages Visited by the User

Display the number of website pages that were visited by the user.

Day of the week DKI

Displays the visitor’s current day of the week based on their local time.

IP address DKI

Displays the visitor’s IP address dynamically.

Redirect DKI

Forward visitors to a different URL when they encounter the shortcode.

Extensions and Integrations with DKI Shortcodes

WooCommerce DKI Shortcodes

Display the number of items in the cart, value in the cart, and more.

Learn more >

Geolocation

Geolocation

Display the visitor`s location name (country, state, city, conteinet, or timezone).

Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Google Ads

Google Ads

Display a value from Google Ads tracking parameters. The value can display the triggered keyword automatically or be set manually. Learn More.

The parameter name without the “?” or “&” prefix. For instance: example.com?param=value
Once the dynamic value is displayed, it will be saved and shown across all pages.
Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Query String

Query String

Displays a value from a URL parameter. Example: domain.com?firstname=David – shows “David”. Demo.

The parameter name without the “?” or “&” prefix. For instance: example.com?param=value
Once the dynamic value is displayed, it will be saved and shown across all pages.
Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Local Time Display

Local Time Display

Automatically shows the event time in the visitor’s local timezone.Demo.

Set time only for a daily event (HH:MM), or add a date for a one-time event (HH:MM mm/dd/yyyy)
Choose how the time will appear to the user. Additional formatting options can be set manually. Learn More
Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
User Details

User Details

Display data from the logged-in WordPress user. Learn More.

Displays if the user is not logged in or the field is not available
Login Link

Login/Out Link

Show a login or logout link based on the user

Referral Source

Referrer

Display the referring URL or domain that led the user to the site. Demo.

Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Browser Language

Browser Language

Display the visitor`s browser-defined language/s.

Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Visit Count

View Count

Visit Count – The total number of pages visited by a specific user.
Trigger View Count – The number of times a specific trigger was seen by a visitor.

For trigger view count only.
Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Show Post

Show Post

Displays content from another post or page. Handy for designing dynamic content with your page builder and injecting it into a trigger. Learn More.

If you used a listed page builder to create the post, select it here.
Alter this option if the shortcode breaks the content design
Redirect

Redirect – DKI builder

Forward visitors to a different URL when they encounter the shortcode. Use this shortcode inside a trigger to create conditional redirects Learn more.

To avoid repeated redirections each time the visitor encounters the shortcode, enter a limiting duration in seconds (e.g., 86400 for one day).
Set a unique identifier of your choice. Required to use the “prevent repeated redirects” option.
IP Address

IP address – DKI builder

Show the visitor’s IP address.

Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).
Day Of The Week

Day of the Week – DKI builder

Insert the current day (e.g. Tuesday).

Shown if dynamic value is unavailable.
Shown only if a dynamic value is available (ignored in fallback content).
Shown only if a dynamic value is available (ignored in fallback content).