Pathnames instead of full urls | Community
Skip to main content
bernardbaltazat
November 19, 2019
Solved

Pathnames instead of full urls

  • November 19, 2019
  • 1 reply
  • 1336 views

I'd like all my data collection query parameters which contain urls to be shortened only to pathnames (e.g. pev1 to be changed from "https://example.com/subpage" to  "/subpage"). I know I can set s.pageURL to change the "g" parameter, but what about others? Is there any way to overwrite e.g. "pev1" or "oid" parameters?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asheesh_Pandey

Option1:

DTM - Go to *`Property`* > **[ Edit Tool]** > Link Tracking and disable "Keep URL Parameters"

Option 2:

DTM - Go to link tracking rule > use custom code in place of UI

Add following code in custom code with in rule

var linkName = _satelite.getVar("Link PathName") //scrape href and convert to pathname in data element.

s.tl(this,'o', linkName);

Thanks,

Asheesh

1 reply

Asheesh_Pandey
Community Advisor
Asheesh_PandeyCommunity AdvisorAccepted solution
Community Advisor
November 21, 2019

Option1:

DTM - Go to *`Property`* > **[ Edit Tool]** > Link Tracking and disable "Keep URL Parameters"

Option 2:

DTM - Go to link tracking rule > use custom code in place of UI

Add following code in custom code with in rule

var linkName = _satelite.getVar("Link PathName") //scrape href and convert to pathname in data element.

s.tl(this,'o', linkName);

Thanks,

Asheesh

- Asheesh