Page Name from Title / URL

The Page Name from Title / URL plugin, is an example of how to fill in your tagging parameters with values extracted directly from your web page basic components. Calling these methods on each page prevents you from setting up a proper tagging plan on each page.

From Title

The page label is defined by the page title that is supposed to be already filled for content and SEO reasons.

From Page URL

The page label is defined by the content of your URL (files, folders, paths…) all depending on your site structure to ensure a view matching your site structure.

Category:

Description

Tag initialisation

SmartTag JavaScript file (to generate in Tag Composer and host on your site)  needs to be initialised in the head in order to trigger page hits.

 

Use page title as page name 

To rely on this option, be sure that the current page already has a title in the first lines of your page.

 

Then call the document.title in the page name tag parameter after the tracker initialisation just like this.

You should get a hit with &p=My%20Beautiful%20Page%20Title displayed as “My Beautiful Page Title” in the analysis.

 

Or use page URL as page name 

With this option your page URL is parsed to become page name and chapters. First thing is to define the variables storing the various versions of your URL labels (files, folders…) before the tag initialisation.

 

Then to adapt to each URL structure you need to add these conditions based on the URL loading the page. Please edit the URLs on second line to match your home page URLs, and send “home” as page label.

 

Eventually, set your page tagging right after the tag initialisation just like this.

 

Reviews

There are no reviews yet.

Be the first to review “Page Name from Title / URL”

Your email address will not be published.

This field can't be Empty
This field can't be Empty
This field can't be Empty
This field can't be Empty