Google Analytics: filtering URI but not events sent together - google-analytics

I need to filter out some URI from Google Analytics (because I send some custom pageviews on these pages instead), but not the events sent together on these pages.
The filter I applied is the following.
Unfortunately, the filter above excludes also all the events sent on the pages included in the Filter Pattern.
How can I filter out the URI but not the events sent on those URI?
Thanks.

The event is tracked at hit level, so filtering the hit on a page also filters the associated event. (I couldn't find a place in the documentation confirming this right now but I'm pretty confident about this).
Instead of the events, you may use custom dimensions or metrics, with a session or user scope (cf. filters). You may want to read more about scopes here, in order to identify which one works for your use case.
Also, please be aware that a view filter is destructive: the filtered information will not be stored, and will never be available in the future. Based on your use case, you may want to take one of these approaches instead:
use segments or filters inside reports instead of view filters.
create an additional view, not containing any filter, so that full dataset is available whenever needed

At the moment, you're using the Filter to remove hits. This means that any hits that match the filter will be lost, including Event and Page View hits.
It sounds like what you require is some kind of search and replace that strips out those custom URIs from the hits that they accompany: so the hits go ahead, but the custom URIs are edited out of them.
Alternatively, you could alter the reporting on those events so that they tell Google Analytics that they take place on a different page.

Related

Using event as view exclude filter in Google Analytics

I have an event that triggers from my tag manager every time someone clicks a certain URL link. This event appears to be tracking properly in GA. However, I am attempting to create a filtered view that excludes traffic that triggers this event. When I use the Filter Verification I get:
"This filter would not have changed your data. Either the filter configuration is incorrect, or the set of sampled data is too small."
Indeed it does not change my data. I am using the event label as the field field/pattern if that makes a difference. Any suggestions?
Ok, there are issues with this question. But first, the answer is: filters aren't meant to remove more than particular hits. They aren't meant to remove sessions or users. Only hits. But there's a hackaround.
Now, more points:
You don't exclude "traffic". Traffic is not precise enough to be useful here. You have to decide what you want to exclude: an event, a session or a user. Or something inbetween, but then you need to define it properly.
A session in Google's understanding is really a bit different from what it seems like. It is custom to believe that a session is a series of interactional events with less than 30 minutes (configurable) inbetween. Not quite. If your source changes, that's a new session. Bear with me.
You... can hack around it if you really need to. By "painting" users or sessions. You do it by setting a specific custom dimension (user- or session-level) and then delete all events that have that custom dimension set using a view filter. The CD will be backfilled, so the filter should clean stuff close to how you expect it to do.
However! GA is... a little bit odd with how they record sessions and users. There may occur a situation when you end up having users or sessions with no events in them. However, if you find this issue at play, you still can export the data to BQ and query it properly. You may find that export cleaner.

Google Analytics: Unifying Single Page Application URLs that Contain IDs

We'd like to track behavior flow in our single page application using Google Analytics. We use the hash to route in the application, and we can track the URL within the app with virtual pageviews as described in Google's documentation. However, many of the URLs in the application contain ids, and are considered distinct URLs, despite representing the same page. Thus, we're unable to get accurate behavior flow information in Google Analytics for those pageviews.
For example,
http://example.com/#/dashboards/8a86204a-7b10-4bf5-961b-be16d209f2b0
and
http://example.com/#/dashboards/d8d6a9b5-b6f1-4159-bd6b-622e628f87b2
would be considered distinct pages, when really, we'd like to group these two urls together to determine how users use the dashboard view, rather than how users use a particular dashboard.
Is there a way to unify URLs like this so we can view metrics and behavior flow in aggregate (either in Google Analytics, or in the SPA)?
Completing the answer from #Eike. You can indeed use virtual pageviews to just set the url to '/#/dashboards' using the command
ga('set', 'page', '/#/dashboards'); and then send your pageview. But in my opinion keep the individuality in your data and use a custom dimension to achieve the aggregation you want. Meaning that you should define first a custom dimension that is named for example 'sitePageAggregate'. This dimension will take the value of your website's 'section' url for example 'dashboards' or 'search results' or anything else that might need the aggregation for the behavior flow. This can be done by code in before your pageview hit in each page like this
ga('set', 'dimensionN', 'dashboards');
where N is the custom dimension index. More info on how you can do this here. Now you will just go to your GA interface, Under Behavior -> Site Content -> All pages and just set the secondary dimension as 'sitePageAggregate'. In that way you are retrieving the results you want.

Google Analytics goal/segmenting set up to track traffic from a single website/URL?

How can I set up Google Analytics goal to track traffic from a single website and track whether the user ends up on specific pages (as in, track how they move through the funnel/website) as well if they convert to a subscriber (I can put that tracking code on a signup / thank you page).
But I am concerned about traffic only from a single domain, as a specific and unique measuring statistic, in addition to overall traffic tracking, obviously.
I can't figure it out for the life of me....
Thanks.
The filtering would not be a goal setting. Set up, either:
A custom segment that filters users based on the referrer / hostname / whatever you need. It sounds like you are looking to filter on the referrer or referrerPath. Then set up the goal and when you report, change the segment
Or set up a separate view that filters for traffic based on the criteria above. That view can then have the goal, inclusive funnels, set up.
Both methods have drawbacks, the second method is cleaner if that goal is something you plan on reporting on for the foreseeable future.

Using advanced filters - Google Analytics

A client I am working for has a requirement to use historical data in Google Analytics to present a report that shows them page views on a specific page, but only when refereed to said page from the homepage, basically like in-site ad tracking. I have discovered that I can create reports that are grouped on a user-defined variable, however I need previous data to also be included in this report, and therefore cannot simply define this inside of my Google Analytics call.
I have therefore been experimenting with Advanced filters, in an attempt to populated the user-defined field with a query-string variable. I have attached an image below illustrate my current configuration:
This configuration isn't populating the "User-Defined" field, and therefore not producing the desired results.
Any help would be appriciated.
Any filters you set will only be applied to new data, not historic.
Probably what you are after can be retrieved through the Analytics API (you can use the Query explorer for that).
Try the following:
dimensions: ga:nextPagePath
metrics: ga:uniquePageviews
filters: ga:previousPagePath=~<YOUR STARTING PAGE>;ga:nextPagePath=~page\=
sort: -ga:uniquePageviews
What the query is asking is "Which are the top pages that include 'page=' did users click on from your starting page?"

Google Analytics - Don't view as unique pages

I have a url similar to this
/widgets/view/13031800
In the google analytics settings you can have it exclude url paramaters, but I can't figure out how to have it look at all
/widgets/view/ pages as one page. I don't need each one to be unique.
Any ideas?
Unfortunately there is not an easy answer to this. You can...
change what is passed in your _trackPageview calls on your page(s) to exclude the number
create a filter in the interface to strip off the number
Neither one of these solutions will retroactively apply (will not change data you already got).
Only way to see it for current data is to export your data to excel or whatever and do some manual work on it, like strip off the numbers and sum up the page views and remove duplicates sort of thing.

Resources