How can I track visitors’ paths from one page to another with full URLs? - google-analytics

Say I have two pages on a site called “Page 1” and “Page 10”. I'd like to be able to see the paths visitors take to get from “Page 1” to “Page 10” with full URLs intact. Many of the URLs (including those for “Page 1” and “Page 10”) will include query strings that are important.
Is this possible? If so, how?

Try using behavior flow reports. The report basically shows you how visitors click through your website. There are a lot of ways to customize the report, with which you will need to play around to really answer your question. By default, the behavior flow focuses on entry and exit points of visitors, regardless how many times they hit the different subpages in between. However, I'm sure you can set appropriate filters and settings to answer your question.

I use two methods for tracking where people have been on my website:
Track and store the information in my own SQL database. (details below)
Lead Forensics (paid subscription, but you can do a trial).
For tracking and storing my own data, I record unique visitors based upon the IP Address they're connecting from and then have a separate table that records all page views that links back to the unique visitor table.
Lead Forensics data simply allows me to link up those unique visitors with actual companies that have viewed my website.
Doing it yourself means you don't have to rely on Google working for your records to work, and in my experience Google Analytics tends to round numbers so you don't get a true indication of numbers, and also you can remove bots and website trawlers from your data by tracking the user agent string.

As a somewhat ugly hack you could use transaction tracking. If you use the same transaction id multiple times subsequent products will be added to the existing data. So assign an ID at the start of the visits and on each page record a transaction with the current page url as product name (and the ID as transaction id). This will give you the complete path per user (I am frankly not to sure how this is useful - at some point you probably want aggregated data. Plus each transaction and product counts towards your quota for interaction counts, so on a large site you might run over the 10mio hits limit).

you can do it programatically
have a MAP in the backend which stores the userId (assuming u would have given a unique ID at the time of login to each user) with a list of Strings(each string being URL visited by that user)
whenever the user hits another URL from Page 1(and only from page1, check it using JS), send a POST request to backend with the new URL in its data section.
In the backend, check if the URL is of Page 10 and if not, add this URL as a string into the MAP for that corresponding user
Finally, when the user clicks on the Page 10 URL, you know the URLs in the way from Page 1 to Page 10 and so use them.

Though if I consider JS and I have not misunderstood your question, we can get the previous URL from request header information using document.referrer.
Are you trying to do it from 'Google Tag Manager'? I am not sure whether you are trying to trace the URLS in clientside or server side?

Related

Categorize Traffic with Specific (non-UTM) Parameter as Email Traffic

I have traffic coming from Salesloft emails sent by sales reps that gets bounced off a subdomain and then has a sbrc parameter appended to the URL. I'd like to ensure that this traffic gets counted by Google Analytics as coming from Email, whereas it's currently falling under the "Direct" bucket. Ideally, users would also be appending utm parameters to their links, but this isn't happening consistently.
I tried creating a filter to search and replace the following regex (?:^|\?|&)(sbrc=[^&]*&?) with ?utm_medium=email&utm_source=salesloft in the Request URI. This changed the displayed URL when looking at my realtime traffic, but did not change how GA categorized the channel of the traffic (still direct).
I then tried editing the default channel groupings for Email to be the system categorized OR Landing Page URL contains "sbrc" and dragged Email to the first channel grouping at the top. This doesn't seem to have done anything at all.
How can I make GA recognize this custom parameter as being attributable to the Email channel?
You could use advanced filters to solve this task. The Advanced filter lets you construct Fields for reporting from one or two existing Fields.
In your case, advanced filters let you assign values to campaign source and campaign medium, based on the content of the request URL. This is a sample setup for the source field, and you need a second similar filter for medium as well:
Ideally, users would also be appending utm parameters to their links,
but this isn't happening consistently.
If they add their own and use a utm_medium other then utm_medium=Email, then it will not be defined as being in the default Email channel.
Filters are not retroactive.
Filters also run after data has already been processed by Google, to only change how it displays in the reports as it gets sent back into the GA reports.
A Search and Replace Filter applied to the RequestURI for
?utm_medium=email&utm_source=salesloft is not going to have the result you want.
It will change the appearance of the RequestURI in reports, not actually change how that traffic is attributed.
Changes to the default Channel grouping are not retroactive, it should have affect going forward though.
To see the changes in historical data for the Channels, you would do best to create a custom Channel grouping at the View level, this can then be applied retroactively to the historic data.

Remove a referral from Google Analytics

My website has a feature to login via Google. So whenever they log in via Google, in my Google Analytics it counts'accounts.google.com' as a referral. Is there any way to prevent this from going to 'referral'?
You have yo use the referal exclusion list, this prevent the session cutting and avoid the creation of new sessions when the user return from account.google.com, but if the domain is google.cm make sure to use the correct domain (you dont want to mess the Organic and SEM data).
To exclude you have to go to the property tab and them referral exclusion list
And them add the domain
This change is not retroactive, that means if the user got this referral as campaign you have to wait until this expire on the server, bu default this is 30 days. So can you see remnants during that date range.
You have set it up already, only thing I would do is escape the dots
accounts\.google\.com
You can Verify the filter before saving.
If there is significant difference in data it will show message otherwise you get this
This filter would not have changed your data. Either the filter configuration is incorrect, or the set of sampled data is too small.
This message means that filter is not significant enough to improve data or set up incorrectly. You may have to play a little with it to get to right result.
Hope that helps.

Should I combine my cookies into one or having multiple ones does not change anything with performance

I have a blog with WordPress and I am using a plugin for the ratings of my posts.
Every time a reader rates an article it creates a cookie just for that article. And every time a reader loads a new page it loads all the cookies for each article he/she rated.
Here is a screenshot of what a reader sees inside his Inspect Element:
Should I modify the plugin and put all this information into one or will it not change anything with the performance of the blog?
My opinion would be, yes, combine them into one cookie. However, cookies have a length limit of about 4k, so if the user reviews a ton of articles you will run into issues with storage. With this approach, you could try segmenting the cookie into multiple compiled cookies, but then you run into issues with checking lengths and end up with a bunch of random code.
What I would do in this situation is assign a user ID to the person and attach that ID to a server-side tracking mechanism. Instead of creating a cookie for each rating, you simply create one cookie (I would recommend PHP sessions). Then attach each review with the ID and the rating as post_meta for the article. Then the cookie would always be the same length, and it would tie the user back to the reviews that they completed. This also allows you to group your reviews together by a single identifier, which would allow you to transfer the reviews to, say, a user account.

can google analytics tell me http referrer for each specific goal conversion?

I have a website that allows people to create an account (that is the conversion I wish to track).
I wish to know where a specific person is coming from. I have google analytics installed and have set up the registration page as a goal, but the reporting tells me traffic sources as an aggregated pie chart. It doesn't report down to the user account level to say that 'person with email xyz' came from 'facebook' for example.
What custom variables or mark up would I need to add to GA to report at that detailed level, if that is at all possible?
Otherwise, I will just have to record the first http_referer in a cookie and stick it in a database during the registration process.
Any advice?
Firstly I must ask you, how actionable do you think it is to look at data at that granular of a level? Finding out what % of people who registered came from facebook or some other place is actionable, because it helps you do things like determine where to focus marketing efforts. But individual users? How is this actionable to you? (hint: it's not)
However, if you are still determined to know this, you should first note that it is against Google's ToS to record personally identifiable data both directly (recording the actual value in GA) or indirectly (e.g. - recording a unique id that you can use to tie to personal info stored within your own system). If this is something you don't want to risk, I suggest moving to another analytics tool that does not have this sort of thing in their ToS (e.g. Adobe SiteCatalyst, which costs money, or perhaps you may instead prefer to choose an "in-house" approach, like Piwik)
If you are still determined to follow through with this and hope not to get caught or whatever, Google Analytics doesn't record data like what info a visitor filled out in a form (like their email address) unless you populate that data in a custom field/dimension/metric/event to be sent along with the request. Usually you would populate this on the form "thank you" page (which is usually the same page you use as your goal url or goal event if you're popping and using an event for your goal). So you would populate the email address in one of those custom variables and then have it as a dimension to break down the http referrer by.

Track where 404s come from in Google Analytics?

I want to figure out how visitors are getting to my /error404 page. I want to see what URL they attempted to visit (e.g., http://mydomain.com/iloveyou) before they received the 404, so I can see what content my users think I have.
You can get by without touching your source files--as long as your error pages/templates are tagged, that's all you need, configuration-wise.
As an aside, our error page template all look about the same so to clearly allow a person viewing the GA data to distinguish the various error pages, we annotate them by passing in a descriptive string to _trackPageview(), e.g.,
pageTracker._trackPageview("404_removed_directory");
Needless to say, this annotation is just for GA, it isn't shown to the user.
So w/r/t viewing the information you are after--i.e., page paths in which one of your error pages is the terminus--you can use either the GA data browser or either of the two GA APIs.
Using the GA Data Export API
I would code my Request this way:
dimensions=ga:previousPagePath
metrics=ga:pageviews
filters=ga:nextPagePath%3D~SomeErrorPage.html
# or if your API client does not require URL encoding, then:
filters=ga:nextPagePath=~SomeErrorPage.html
If you haven't used the GA Data Export API, the Data Feed page shows a complete API Request that you can use as a template.
In addition, Google's Data Feed Query Explorer is a decent sandbox to interactively test the queries that comprise your Requests.
Using the GA data browser
From the main Dashboard, on the left-hand side panel, click Content, then click Overview underneath it. To the right, in the main window, you will see a heading under the Pageviews chart, called Navigation Analysis, this has two linked options under it, Navigation Summary and Entrance Paths. clicking the latter will reveal the view shown below. In the textbox, just enter the name of your error page to get the entrance path for that error page.
Finally, relying on your server access log for this information is less reliable for all of the usual reasons (caching, etc.), in addition, given your question is specific to GA, i assume you already use GA, so modifying your config file, and parsing the activity log, if you are not already doing so, is a lot of trouble, compared to getting a more accurate count of the same data through a channel (GA) you have already set up.
You don't need google analytics for this - just expand the logging of your webserver to log referer data for this specific page. With this information you can see where the majority of people are coming from.

Resources