Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

I'm capturing the entirety of the URL currently as a default for the SiteCatalyst pageName. But I would prefer it match the format within google. So instead of http://www.mystite.com/dir/index.html, I want the url to display as www.mysite.com/dir/index.html. Simple, right? But what's the quickest and best way? Thanks in advance.
8 REPLIES 8
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Tealium Employee
I am sure there are a few way to do this but one would be to use a set data values extension. Create a data source called something like pname Set pname to js code b['dom.url'].replace(/.*?:\/\//g, ""); Then map pname to pageName in your tag mappings. I am not sure about the code here but it should work with something like this. Hope it works
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

The part in parenthesis is reg ex, correct? What does the "g" do here? Thanks, Jim. I've been following some of your questions so I figured you might have relevant experience. Seems like we are on the same path, more or less.
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Employee Emeritus
A less technical solution: A method would be to use the Join Data Values extension to join Domain (DOM) and Pathname (DOM) from your Data Sources in your Page Name variable that is/will be mapped in SiteCatalyst. For the Join Data Values extension, leave the separator blank (to avoid duplicate slashes) then, select Domain first and then Pathname second.
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Tealium Employee
No problem. "g" means global so that it replaces all matches and not just the first match, so if there were multiple occurrences it would replace all.
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Employee Emeritus
an additional thought, if the end game is to create consistency between your GA data set and your SC data set then I would recommending mapping "pname" (as Jim names it above) to both the GA and SC page name variables so that the exact same data is being sent to both tags.
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Clint, the pathname (DOM) will exclude query parameters, correct?
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Employee Emeritus
yes it would.
Highlighted

What's the best way to modify the raw URL to remove the protocal (Http://) or .com portions of the domain name?

Excellent. This was very helpful. Thanks, guys.