Expand my Community achievements bar.

Announcement: Calling all learners and mentors! Applications are now open for the Adobe Analytics 2024 Mentorship Program! Come learn from the best to prepare for an official certification in Adobe Analytics.
SOLVED

How to build a segment that track a specific url

Avatar

Level 3

Hi, 

I am trying to build a segment that tracks the main page of a category, plus all his sub categories/sub-pages.

Let's say that my site look like this: 

main category: www.mysite.com/product/shoes

subcategories: 

www.mysite.com/product/shoes/women 
www.mysite.com/product/shoes/men 
www.mysite.com/product/shoes/kids
www.mysite.com/product/shoes/kids/winter and so on.

and that I want to track the "shoes page" plus "all the shoes subpages"
 (women,men,kids, kids winter) with a segment.

So my "magic string" is "shoes", and I was thinking to build a segment where:

PAGE contains /product/shoes/ (in order to track all the subcategories)

but it doesn't work because Adobe shows also page like www.mysite.com/search or www.mysite.com/index.html

and if I create PAGE URL (props) contains /product/shoes/ (in order to track all the subcategories) shows zero results.

Any suggestion in how build a segment like that? 


Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 3

HI GL,

 

The PAGE segment should work if the Page name is correct. Take a look at the source code of a page you want to include and check if gwa_pagename contains "/product/shoes/".

 

The PAGE URL segment should work without conditions. Can you post a picture of the segment?

 

Cheers,

Martijn

View solution in original post

5 Replies

Avatar

Correct answer by
Level 3

HI GL,

 

The PAGE segment should work if the Page name is correct. Take a look at the source code of a page you want to include and check if gwa_pagename contains "/product/shoes/".

 

The PAGE URL segment should work without conditions. Can you post a picture of the segment?

 

Cheers,

Martijn

Avatar

Level 3

Hi,

thanks for the answers. I set up a page URL segments exactly like this:

Page URL contains http://www.mysite.com/product/shoes

When I run it, I get the shoes page and also the subcategories, so:

http://www.mysite.com/product/shoes
http://www.mysite.com/product/shoes/women 
http://www.mysite.com/product/shoes/men 
http://www.mysite.com/product/shoes/kids

but then also the index.html and other pages like http://www.mysite.com/product or http://www.mysite.com/blog and I don't understand why. Should I filter deeply somehow? Or use other conditions?

thanks.

Avatar

Level 3

I see. You probably have the segment at the level of "visitor" or "visit". You will see all other pages of a visitor or during a visit (on a product/shoes pages) as well.

Change it to "Hit". You can find this under "Definitions" in the drop down box "Show".

 

Cheers,

Martijn

Avatar

Level 3

Thanks so much, it works! Just another clarification.

Let's say that I want to built my segment to match all the pages and subpages that have inside the url "shoes-men". So for example I want to track "shoes-men" and also "shoes-men/new-collection" so in my previous example:

http://www.mysite.com/shoes-men
http://www.mysite.com/shoes-men/new-collection

Then if I use a segment that says PAGE URL (props) HITS contains "www.mysite.com/product/shoes-men"

I am able to track both categories (shoes-men and shoes-men/collection) correctly, but this segment unfortunately tracks also pages like "www.mysite.com/
/coat-men" because of the string "-men"

How can I solve this issue?

Thanks!

Avatar

Level 3

You're welcome.

The coat-men url really should not appear in the results. Maybe you did not 'apply''  the segment after you changed it? A picture of your segment woul help.

On a side note, it is better to use the page name instead of the url when creating a segment. Url's change more often than page names.

Cheers,

Martijn