Personalize Your WordPress Website Based on Ad Campaigns (No Plugins Needed!)

Aanand Madhav

Published On:

2 Feb 2025

different browser images on right and blog heading on left.
different browser images on right and blog heading on left.
different browser images on right and blog heading on left.

Introduction

Imagine you run a travel website offering deals on luxury hotels, adventure tours, and budget-friendly vacations. You’re investing in Google Ads, bringing visitors to your site with keywords like “best 5-star hotels” or “cheap flights under $200”.


But here’s the problem

💡 Every visitor lands on the same generic page.

Wouldn’t it be better if someone searching for “adventure vacations” automatically saw content about thrilling mountain treks and extreme sports packages, while someone searching for “luxury resorts” saw a homepage featuring 5-star beach resorts?

This creates a personalized experience.

It increases conversions.

And you can do it without plugins!


Why Do This Without a Plugin?

Most WordPress users rely on plugins for dynamic content personalization, but using PHP gives you:

Faster performance – No bloated plugins slowing down your site.

More control – Customize the experience exactly as you need it.

No compatibility issues – No conflicts with Elementor or other page builders.

Now, let’s implement keyword-based content personalization in WordPress—without plugins. 🚀


How It Works

When a user clicks on an ad, the URL contains tracking parameters like:

From this URL, we extract the utm_term (or keyword) and dynamically map it to the right travel category.

For example:

“luxury resorts” → Show content about Luxury Hotels

“budget travel tips” → Show content about Affordable Hotels

“adventure vacations” → Show content about Extreme Adventure Tours


Now, let’s code this!

Step 1: Add PHP Code to Your functions.php File

This PHP function:

• Reads the keyword or utm_term from the URL.

• Maps it to a travel category.

• Displays the correct category name via a shortcode.


Step 2: Use the Shortcode in WordPress

Simply place this shortcode anywhere in WordPress to display personalized content:

[mm_utm_keyword_to_adgroup]

📌 Where to place it?

✅ Inside blog posts and pages

✅ In Elementor text widgets

✅ Inside headers or call-to-action sections

Step 3: Test Your Setup

Example 1: Luxury Hotels Visitor

URL:

👀 What they see: "Luxury Hotels"

Example 2: Budget Traveler

URL:

👀 What they see: "Budget Travel"

Example 3: No UTM Keyword

URL:

👀 What they see: "Discover Amazing Travel Deals" (default fallback text)

Bonus: Improve Conversions with a CTA

Since we’re personalizing content, let’s also add a high-converting call-to-action (CTA).

HTML for a CTA Block

<div class="travel-cta">
    <h3>🌍 Looking for the Best <span>[mm_utm_keyword_to_adgroup]</span>?</h3>
    <p>We have exclusive deals just for you! Don't miss out.</p>
    <a href="#lead-form" class="cta-button">Get Your Exclusive Offer</a>
</div>

CSS for Styling



Want to implement this on your website without hassle?

Let’s talk ➡️


Final Thoughts

🚀 With just a few lines of PHP, you’ve transformed your WordPress site into a personalized travel experience.

✅ Visitors see exactly what they searched for.

✅ Your conversion rate improves because content feels more relevant.

✅ No heavy plugins, just clean and efficient PHP code.


Want to take this further?

• Dynamically change headlines, CTAs, and images.

• Use JavaScript to instantly update content without refreshing the page.

• Track conversions with Google Analytics & heatmaps.