Analytics
4.3K members online now
4.3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

URL Builder - Automatic Addition of Trailing Forward Slash (domain name vs filepath)

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

Regarding the URL Builder, I noticed that if only the domain is entered into the URL field, it is trailed by a foward slash and question mark when the URL+UTM code is generated; alternatively, if a domain and path are entered into the URL field, the URL builder trails it with only a question mark - why is a forward slash included in one scenario and not the other? Is there any harm in manually adding a forward slash in the latter scenario (yes, the URL still works when the forward slash is added - I'm wondering if it will cause any unexpected reporting issues, etc.).

 

Thanks in advance!

 

-J

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Jessica P
July 2016

Re: URL Builder - Automatic Addition of Trailing Forward Slash (domain name vs filepath)

Top Contributor
# 2
Top Contributor
Hi,

The URL format requires a "/" before the URL path, that is why URL builder is adding it before the query string. It may work without it but it is not correct.

There is no requirement for the URL path to have a trailing slash so URL builder won't add one.

If your URLs are working with and without the trailing slash, Google Analytics will track them as separate pages. You may want to redirect the version without the trailing slash to the trailing slash version. Most webservers do this by default.

So if in your reports your page has no trailing slash and you add one to the URL you built in URL builder you end up tracking them separately.

Hope this helps, let me know if you have questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Jessica P
July 2016

Re: URL Builder - Automatic Addition of Trailing Forward Slash (domain name vs filepath)

Top Contributor
# 2
Top Contributor
Hi,

The URL format requires a "/" before the URL path, that is why URL builder is adding it before the query string. It may work without it but it is not correct.

There is no requirement for the URL path to have a trailing slash so URL builder won't add one.

If your URLs are working with and without the trailing slash, Google Analytics will track them as separate pages. You may want to redirect the version without the trailing slash to the trailing slash version. Most webservers do this by default.

So if in your reports your page has no trailing slash and you add one to the URL you built in URL builder you end up tracking them separately.

Hope this helps, let me know if you have questions.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital