Computer Science, asked by Bharathnihan9300, 11 months ago

Briefly describe about the different component of url

Answers

Answered by Gauravkulkarni211
2

Answer:

URLs (Uniform Resource Locators) are something that we all see and deal with all the time, but the terminology that relates to the component parts of the URL are often misunderstood. This post attempts to explain them.

A URL usually consists of the following components:

Protocol, domain, path (or pathname), hash and query string.

Protocol is the technology that will be used to transfer the data, usually http or https

Domain is the the domain name, tealium.com for example.

Path relates to the section and page on the site

Hash relates to a section within the page

Query string contains data that is being passed to the page

In the data layer

In terms of the data layer, this would appear as

dom.domain: "tealium.com"

dom.pathname: "/solutions/"

dom.query_string: "example=test&example2=test2"

dom.hash: "section3"

dom.url: "http://tealium.com/solutions/?example=test&example2=test2#section3"

Load rule example

This is typically useful for load rules, where you want tags to fire for specific sections or pages of the site.

Lets say you have a site which consists of several domains, and you want a load rule so that tags fire for any page on domain1.com - you could create a simple load rule like this:

Domain based load rule

Now how about if you only wanted to fire a certain tag on the homepage, and only on domain1.com

Domain and path based load rule

Or if you wanted a load rule for any page in a support section, on any of your domains

"Pathname contains" load rule

Or, you wanted section2 hash of any support page, or if there was a query string which contains support=true

Pathname, hash and query string based load rule

Hopefully these examples show how you can build a load rule based on the data layer URL components.

Similar questions