Skip to main content
All CollectionsUser guides and instructions
How to use URL query parameters in Merge Tags
How to use URL query parameters in Merge Tags

Learn how to set up Merge Tags with URL query parameters to insert dynamic content into the widget

M
Written by Maryna Hura
Updated over a month ago

Claspo's URL query parameter in Merge Tag allows you to dynamically personalize widget content based on the customer journey. This feature helps you:

  • Show visitors content that aligns with the message they saw in an ad.

  • Match the widget content with the page context viewed by the user to reinforce conversions.

  • Save time — use one widget with dynamic content instead of multiple ones to adapt to different visitors automatically.

How Merge Tags with URL query parameters work

This is what happens technically:

  1. A user visits a page with a URL containing specific query parameters (such as UTM tag, category, referrer etc.).

  2. Claspo extracts a specific value from the URL and inserts it into the widget text dynamically.

For example, a visitor lands on your site from an ad on a page with the URL ‘www.yoursite.com?utm_campaign=triathlete…’ The platform detects utm_campaign=triathlete and displays ‘triathlete’ in a widget dynamically.

Setting up Merge Tags with URL query parameters

To add the dynamic content, select a word in the widget text to change dynamically.

Click the Merge Tag on the right and choose a URL query parameter from the drop-down.

Fill in both fields: URL query parameter and Example value (in our example we use ‘utm_campaign’ and ‘triathlete’).

The preview will display ‘triathlete’ for visual assessment. Once live, the widget will automatically replace it with the actual utm_campaign value for each visitor.

Important

  • If the query parameter specified in the widget is missing or empty in the URL, the widget won't be shown.

  • If the parameter was found earlier in the session but is missing now, the widget will still display as the value is saved in memory.

Example use cases

Let's explore a few tasks you can accomplish with this functionality.

Personalization based on UTM campaigns

Let’s say we sell diet desserts and run different ads targeting various audience segments. Instead of creating separate widgets for each, we can use a single widget that personalizes itself based on the UTM tag.

Since the text will be pulled from the link, consider the following in advance:

  • Choose a keyword for UTM tag that makes sense when inserted into your widget text.

  • Keep it concise — shorter, clearer words work best (for example, ‘beachbody’ instead of ‘beach_weight_loss’).

Here is how we can structure UTM parameters for different segments:

Audience segment

Example URL with UTM

Beach season dieters

www.yoursite.com?utm_campaign=beachbody

Healthy eaters

www.yoursite.com?utm_campaign=healthy

New-moms

www.yoursite.com?utm_campaign=mom

In the editor we use a Merge Tag for URL query parameters to insert dynamic content into the widget. Example widget message: ‘Looking for {utm_campaign} treats? Enjoy our guilt-free desserts today!’

In action, each segment will see a personalized message:

  • A visitor from the Beach season dieters ad sees: ‘Looking for beachbody treats? Enjoy our guilt-free desserts today!’

  • A visitor from the Healthy eating ad sees: ‘Looking for healthy treats? Enjoy our guilt-free desserts today!’

  • A visitor from the New-moms ad sees: ‘Looking for mom treats? Enjoy our guilt-free desserts today!’

Personalized category discounts on subscriptions

For the next example we use URL query parameters to personalize a subscription widget with a 10% discount, dynamically inserting the category of clothing the user is browsing. This makes the offer feel more relevant, increasing the chances of both sign-ups and conversions.

Example URL structure:

Product category

Example URL with category parameter

Dresses

www.yoursite.com?category=dresses

Tops

www.yoursite.com?category=tops

Jeans

www.yoursite.com?category=jeans

In the editor, we use a Merge Tag for URL query parameters to insert the category name into the subscription widget.

Example widget message:

In action, every visitor will see a personalized message:

  • A visitor browsing dresses sees: ‘Love dresses? Subscribe now and shop your favorites with a 10% discount!’

  • A visitor browsing tops sees: ‘Love tops? Subscribe now and shop your favorites with a 10% discount!’

  • A visitor browsing jeans sees: ‘Love jeans? Subscribe now and shop your favorites with a 10% discount!’

Did this answer your question?