Filtering URL - Google Analytic - google-analytics

I have the following URLs :
example.com/Style/mens/
example.com/deliver/Style/47968/
example.com/49549/Style/
My target is:
example.com/Style/mens/
I need to filter /Style/ only at the beginning and not in any other place in the URL.
What is the Regex for this issue?

Try
^example\.com\/Style.*
This will filter anything like
example.com/Style
example.com/Style/something
example.com/Style/something/nothing

Related

Combining similar URLs in Google Analytics (with a twist)

I have a lot of similar URLs that I would like to merge in Google Analytics. I've managed to merge a lot of them already. However I've now run into a bit of a problem.
I have URLs that look something like this;
article/4567/edit
article/87478548/edit
article/82984786/add
article/8374/add
How would I go about merging these URLs so that they display as;
article/edit
article/add
Any help is greatly appreciated.
EDIT: I also need to be able to have GA display every article in one line on the table called "article/" regardless of any ID that is after it. I don't want the table to look like:
article/12342 1,000 views
article/7465890 900 views
I need it to display as:
article/ 1,900 views
You can create an Advanced filter that combines the relevant parts for you:
The output would be /article/edit or /article/add, with everything and anything between those removed.
EDIT:
If you just want everything, regardless of /edit, /add, /12341/edit, /7305/add, /whatever/edit, to show up just as /article, then you can just change your filter like this:
Field A: Request URI = (/article)/.*
Output to: Request URI = $A1
This will convert the following examples:
/article/123/edit -> /article
/article/2345/add -> /article
/article/anything -> /article
From this Combining similar URLs in Google Analytics you can find out how to do it. You need to use a regex. Something like this should work (did not test it).
(article\/)[0-9]*\/(edit|add)

How to use the | (or) operator in google analytics filter?

I have a filter I want to apply to my google analytics chart embedded in my site. I want to filter ga:pagePathLevel2 to be one of a list of numbers;
Ideally I want it to be something like
'filters' : 'ga:pagePathLevel2==/6|/7|/8',
but that doesnt work, My authorization button doesnt show up after that so apparently something doesn't work
You can use a the =~ syntax to set a regular expression filter if you want to match a URL part in several possible forms.
If your case, you could do something like:
'filters': 'ga:pagePathLevel2=~^/(6|7|8)'
On an unrelated note: if your auth button isn't showing up at all, it's almost certainly because you have a syntax error and has nothing to do with the filter syntax. If you open up the developer console, you should see the error being logged.

GSA Wildcard search and suggestion not working together

I'm using GSA 7.2 version which supports wildcard search but as soon as I enable it then spelling suggestions stop appearing. Please take a look below URL and suggest what should be done so that I start getting it.
http:// {host-name}/search?start=0&num=1000&site=xyzTest&output=xml&client=frontend&filter=0&getfields=&q=sken
In the above query, search term is "sken", GSA suggestion tag should appear and provide suggestion for "skin" but it is not happening.
Is spelling suggestion enabled in your frontend?
If not enable it by setting 1 to the show_spelling variable in the xslt.
i.e: <xsl:variable name="show_spelling">1</xsl:variable>
From the GSA Documentation:
When using daterange or inmeta queries, spelling suggestions are not returned.
To view spelling suggestions, use the requiredfields parameter instead of inmeta

Wordpress : Url Rewrite

I am trying to rewrite a url in wordpress so that I can serve up dynamic content based on variables that are passed. I have a plug in that needs variable data passed into it. Currently I have:
http://xyzsite.com/page/?var1=something
this works fine and passes in a $_GET var. So my next step is to clean up the variable so that it looks like
http://xyzsite.com/page/something
I have done a few google searches and come accross some site that looked promising but I cannot get any of them to work. From what I have read, i need to use
add_rewrite_tag and add_rewrite_rule
After reading through the articles I have added this to my functions.php page:
add_rewrite_tag('%var1%','([^&]+)');
add_rewrite_rule('^page/([^&]+)/?','index.php?p=1141&var1=$matches[1]','top');
when i navigate to the page http://xyzsite.com/page/something i get a 404 error. When i navigate the to http://xyzsite.com/page/?var1=something it is still working fine. So it looks as if my rewrite is not registering or working correctly.
Can someone help me to achieve the above rewrite. FYI my permalink settings is set to post name if that matters at all. Thank you.
I̶'̶m̶ ̶n̶o̶t̶ ̶a̶ ̶r̶e̶g̶e̶x̶ ̶p̶r̶o̶,̶ ̶b̶u̶t̶ ̶I̶ ̶s̶u̶s̶p̶e̶c̶t̶ ̶a̶n̶ ̶i̶s̶s̶u̶e̶ ̶i̶n̶ ̶y̶o̶u̶r̶ ̶r̶e̶w̶r̶i̶t̶e̶ ̶r̶u̶l̶e̶:̶
a̶d̶d̶_̶r̶e̶w̶r̶i̶t̶e̶_̶r̶u̶l̶e̶(̶'̶^̶p̶a̶g̶e̶/̶(̶[̶^̶&̶]̶+̶)̶/̶?̶'̶,̶'̶i̶n̶d̶e̶x̶.̶p̶h̶p̶?̶p̶=̶1̶1̶4̶1̶&̶v̶a̶r̶1̶=̶$̶m̶a̶t̶c̶h̶e̶s̶[̶1̶]̶'̶,̶'̶t̶o̶p̶'̶)̶;̶
̶
̶N̶o̶t̶e̶ ̶t̶h̶e̶ ̶/̶?̶ ̶y̶o̶u̶'̶v̶e̶ ̶a̶d̶d̶e̶d̶ ̶a̶t̶ ̶t̶h̶e̶ ̶e̶n̶d̶.̶ ̶T̶h̶u̶s̶ ̶y̶o̶u̶ ̶s̶h̶o̶u̶l̶d̶ ̶a̶c̶c̶e̶s̶s̶ ̶y̶o̶u̶r̶ ̶p̶a̶g̶e̶ ̶w̶i̶t̶h̶ ̶h̶t̶t̶p̶:̶/̶/̶x̶y̶z̶s̶i̶t̶e̶.̶c̶o̶m̶/̶p̶a̶g̶e̶/̶s̶o̶m̶e̶t̶h̶i̶n̶g̶/̶?̶ ̶a̶n̶d̶ ̶n̶o̶t̶ ̶x̶y̶z̶s̶i̶t̶e̶.̶c̶o̶m̶/̶p̶a̶g̶e̶/̶s̶o̶m̶e̶t̶h̶i̶n̶g̶.̶ ̶H̶a̶v̶e̶ ̶y̶o̶u̶ ̶t̶r̶i̶e̶d̶ ̶i̶f̶ ̶t̶h̶a̶t̶ ̶w̶o̶r̶k̶s̶?̶
The stroked out text above is wrong, as Gustavo Straube pointed out in the comments. Please disregard that proposed solution.
My only last advice is to try adding a flush_rules(); after your last add_rewrite_rule, as stated in http://codex.wordpress.org/Rewrite_API/flush_rules.
Note that you should be accessing your query vars with get_query_var('var_name') instead of trying to access $_GET directly.

Unknown site using our analytics code

I did a review on our google analytics this morning and realised that we have a unknown site using our analytics code; this is because they copied our site design and even used our source code letter for letter.
Is there a way to filter out this site from our google analytics as there data is essentially scewing our data.
Cheers
You can filter out their data.
First, you can figure out what the domain is by adding the 'Hostname' secondary dimension in your content view. Once you have a handle on what hostnames its using (www.thief.com, thief.com, subdomain.thief.com, or whatever).
Create the filter (Instructions here: http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55494)
Set the filter to exclude traffic from the thief's hostname.
alt text http://files.droplr.com.s3.amazonaws.com/files/15648633/1x0Cbj.Screen%20shot%202010-08-13%20at%2011%3A43%3A42.png
(This thread has some details on how this implemented: http://groups.google.com/group/analytics-help-basics/browse_thread/thread/051be84cfb20338a?pli=1)
#yahelc , while your instructions are OK if you look at documentation, this filter often doesn't work.
I recommend to use
Custom Filter / Exclude filter / Filter field : Hostname , where can use a regexp pattern
To test your pattern, Go in Visitors / Network Properties / Hostname, and give it try in the filter box

Resources