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

Demo

People in California love If-So!

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

The 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 Generator

Use the shortcode generator below to generate your Geolocation DKI shortcode:

Geolocation

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).
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 languages other than English?

    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

Insert keywords into your web pages using simple shortcodes.

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.

[ifsoDKI type='geo' show='country']

The shortcode above inserts the user’s country, other information can be displayed by replacing the value of the “show” parameter.

More Options >

Google Ads DKI

Insert the keyword that was used to trigger your ad.

[ifsoDKI type="google-ads" parameter="YOUR-PARAMETER" fallback="Your default value (optional)"]

Learn more >

Query String DKI

Display the value of any query string.

[ifsoDKI type="querystring" parameter="YOUR-PARAMETER" fallback="Your default value (optional)"]

The shortcode above will display the value of the parameter “YOUR-PARAMETER”. I.e. if the page URL is example.com?YOUR_PARAMETER=Awesome, the word Awesome will be displayed.

Learn more >

Auto-Local Time Display

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

[ifsoDKI type='time' show='user-geo-timezone-sensitive' time='04/25/2022 08:00' format='n/j/o, G:i']

Learn more >

User Details (for logged-in users)

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

[ifso_user_details show="firstName" fallback="Default value (optional)"]

More User Details DKI options >

Display a login/logout link.

[ifso_login_link login_redirect="https://example.com/account" ]

The shortcode above will display a login/logout link, the user will be redirected to a page you choose after logging in.

Learn more about the Log In/Out shortcode >

Referral Source DKI

Display the URL of the referral website or webpage.

[ifsoDKI type='referrer' fallback="Default value (optional)"]

What is your referral?

Browser Language DKI

Display the user’s browser language.

[ifsoDKI type='language' show='primary-only']

More Browser Language DKI options >

Total Number of Pages Visited by the User

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

[ifsoDKI type='viewcount' show='visit-count']

Post ID

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

[ifso-show-post id="123"]

Learn more >

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 >