Dynamic keyword insertion for landing pages

🤖

🤖

🤖

Dynamic keyword insertion for landing pages

Dynamic keyword insertion for landing pages

Dynamic keyword insertion for landing pages

Dynamic Keyword Insertion (DKI) allows you to personalize landing pages by automatically injecting the keyword that triggered your ad — improving relevance, user experience, and Quality Score.

This guide walks you through the full setup using Google Tag Manager (GTM) and Google Ads tracking parameters.

🔧 Prerequisites

To complete the setup, you’ll need:

  • Access to Google Tag Manager

  • Ability to update Google Ads tracking templates

  • Admin access to your website or CMS

1. Set up URL parameters in Google Ads

In your Google Ads account, add the following tracking template at the account level:

This ensures that every ad click appends relevant data to your landing page URL.

2. Add HTML to your website

Place the following HTML snippet wherever you want the dynamic keyword to appear on your landing page:

<div id="keyword-section">
  <h2>Welcome to our <span id="dynamic-keyword"></span></h2>
</div>

💡 You can update the text and styling to fit your design — just keep the id="dynamic-keyword" intact.

3. Install the script via Google Tag Manager

In GTM:

  1. Go to TagsNew

  2. Choose Tag Type: Custom HTML

  3. Paste this code:

<script>
(function(w,d,s,l,i){
    w[l]=w[l]||[];
    var f=d.createElement(s),
        j=d.getElementsByTagName(s)[0];
    f.async=true;
    f.src='https://storage.googleapis.com/clickswizz/dynamic%20keyword%20insertion%20JS.js';
    j.parentNode.insertBefore(f,j);
})(window,document,'script','KeywordInsertion','https://storage.googleapis.com/clickswizz/dynamic%20keyword%20insertion%20JS.js');
</script>
4. Configure Your Trigger

Choose one of the following options based on where you want the script to run:

  • All Pages: Use the "All Pages" trigger for sitewide keyword insertion.

  • Single Page: Use "Page View → Page URL equals [your-url]".

  • Group of Pages: Use "Page URL contains [path]" (e.g., /products).

  • Advanced: Use "Page URL matches RegEx" for full regex control.

🧠 Pro Tips

  • ✅ Test everything in GTM’s Preview Mode before publishing

  • 🕵️‍♀️ Open your browser console to check for any script or loading issues

  • 🔗 Ensure your Google Ads tracking template is properly saved