Download

Documentation

Print This page

How can I show a World map of visitors in front-end using a shortcode?

Displaying a world map to visualize the geographical distribution of your site’s visitors can enhance your website’s interactivity and provide valuable insights. 

Implementing this feature using shortcodes is straightforward with Analytify Pro. Below, you’ll find step-by-step instructions on displaying a World Map of visitors using the Analytify shortcode.

Requirements

How to Display World Map of Visitors in the Frontend

Step 1: Choose the Analytify Shortcode Block

First, edit the post or page where you want to display the visitors’ world map.

edit the post on WordPress

Then select the Analytify Shortcode block.

Shortcode-Selection-2.

After this, choose the Advanced Shortcode option.

Advanced-ShortCode-Selection.png

Step 2: Paste the Analytify ShortCode

After selecting the Analytify advanced shortcode, you need to copy the code below and paste it.

Analytify World Map Shortcode

You have two options for displaying the world map, depending on your data presentation needs:

1. For a Specific Date Range:

If you wish to display visitor data for a specific timeframe, use the following shortcode:

[analytify-worldmap start_date="2024-06-23" end_date="2025-06-23" analytics_for="full"]

Replace 2024-06-23 with your desired start date and 2025-06-23 with your end date. This shortcode will generate a world map showing visitor statistics for the specified period.

2. For Data Up to the Current Date:

To show visitor data from a specific start date up to today, use this shortcode:

[analytify-worldmap start_date="2015-10-22" analytics_for="full"]

Simply change 2015-10-22 to the start date you want. The map will automatically update to display data from the specified start date to the current day.

Top Countries World Map Frontend

By utilizing the correct Analytify shortcode, you can efficiently add a dynamic world map to your site, displaying where your visitors are coming from.

3. For Specific Page/Post:

If you wish to display visitor data on a world map for a specific page or post, you can use the following shortcode format:

[analytify-worldmap start_date="2025-01-01" end_date="2025-06-01" analytics_for="page_id" page_id="15510"]

In this example:

  • start_date is the beginning of the date range (e.g., “2025-01-01”)
  • end_date is the end of the date range (e.g., “2025-06-01”)
  • analytics_for=”page_id” tells Analytify to fetch analytics data for a specific page or post
  • page_id=”15510″ should be replaced with the actual ID of your target page or post

This shortcode displays a world map showing the geographic distribution of visitors for the selected page or post during the specified date range.

If You Only Want to Set a Start Date:

You can also generate the map using only the start date. In this case, Analytify will fetch data from the specified start date up to the current date automatically:

[analytify-worldmap start_date="2025-01-01" analytics_for="page_id" page_id="15510"]

This is useful when you want to display continuously updating data starting from a specific date without setting a fixed end date.

Replace the date values and page_id with your own to match the data you want to visualize.

Top Countries Page Level World Map

If you have any further questions, feel free to contact our support team.