Skip to main content

Vanity URL

Siva Balan avatar
Written by Siva Balan
Updated over 3 months ago

Control how your CLP URL appears to users using Vanity URLs.

When setting up a Content Landing Page (CLP) or Content Hub (CH), you may wish for the page to have a human readable URL. You can achieve this by setting up a Vanity URL for your CLP.

Use cases for Vanity URLs include improving the cosmetics or "nativeness" of the URL structure for users, improving SEO value of the URL, or including data useful to other site processes.

Vanity URLs are built by replacing tokens in the URL with campaign specifics, such as headline or advertiser, at serving time.

What are tokens?

Tokens are placeholders within your CLP URL path that are replaced at runtime. In a Vanity URL, these tokens are surrounded by square brackets, like this: [ADVERTISER].

For example, a complete URL might appear as follows.
https://site.com/sponsored/[ADVERTISER]/[PERMALINK]?prx_t=[KEY]

This would be replaced with the following live URL.
https://site.com/sponsored/bloomsbury-publishing/this-years-best-reads?prx_t=AHguT2UJhhMNUIK

Tokens Reference

Content Landing Page Tokens

Token

Renders As

[KEY]

An alpha-numeric string which specifies which article to render. This is required, after the string ?prx_t=

[DAY]

Article publish date: 2 digit day

[MONTH]

Article publish date: 2 digit month

[YEAR]

Article publish date: 4 digit year

[PERMALINK]

Permanent Link to the article. Normally the article title, but users can override at the ad level. This will be standardized to all lowercase, and spaces will be replaced with dashes.

[CAMPAIGN_ID]

Numeric Campaign ID

[ARTICLE_ID]

Numeric Article ID

[ADVERTISER]

Advertiser Name

[ADVERTISER_ID]

Advertiser's ID

[PUBLICATION_ID]

Numeric Publication ID

[DOMAIN]

Replaces the CLP link domain with the domain of the referring page. Allows a single CLP to be used across variable domains.

[PATH]

Repeats the path or segment of URL in the CLP link. Allows a single CLP to appear within variable paths. Must appear within the internal path structure of the URL, for example:
https://site.com/[path]/sponsored

Content Hub Tokens

Token:

Renders As:

[CONTENT_HUB]

Content Hub Name

[ADVERTISER_ID]

Numeric ID of the Advertiser connected to the hub

[PUBLICATION_ID]

Numeric ID of the Publication the hub is on

[CONTENT_HUB_ID]

A numeric string used to populate the Hub with content. This token is required, after the string ?ntv_adpz=

Setting Up Your Vanity URL

Once you've decided how you want your URL to appear, contact your Nativo Account Manager to update your integration settings.

You will need to update the CLP template page so that it is "URL Agnostic". This means that regardless of what comes after the base URL, the template page will still render as expected. This is a technical process that can be done using URL rewrite rules or NGINX rewrite rules.

Here is an example script for use on an Apache web server, using https://site.com/sponsored/ as the CLP to which the Vanity URL will resolve. The following would need to be added to either the server’s httpd.conf or .htaccess file:

Example

RewriteEngine On RewriteBase "/sponsored/" RewriteCond "%{REQUEST_FILENAME}" !-f RewriteCond "%{REQUEST_FILENAME}" !-d RewriteRule "^([a-z-]+)\/?$" "/sponsored/" [L]

❗️Note

The code above is just one example and should only be considered a reference. Consult with your technical team to determine the appropriate code for your servers and the desired URL structure.

Did this answer your question?