Google Analytics using same tracking ID in sub folders - google-analytics

I have a website lets say http://www.example.com which is on shopware and uses google analytics to determine site traffic. I have designed a landing page which is placed at http://www.example.com/landing/index.html. Can I use the same tracking id that I have on other pages on my landing page? Will it appear under all website data section or will it create another automatically?
Actual website is not at example . com its just for reference purpose.

Yes, of course. The Google Analytics web tracker is client side code, it does not really care if your pages have been created by a shop system or by manually entering code somewhere. By the time it is displayed in the browser it's all just HTML.
The data will show up in "All Website data" (which is the only view GA ever creates automatically, everything else you need to set up yourself as needed).

Related

How to track single folder traffic in Google analytics?

I have forum directory on my website. That sub directory is located on http://www.mobilestore.pk/forum I was wondering that how can I track forum traffic only as a separate property in Google Analytics without filtering it from the whole traffic of the website. So I can show the trends of forum to Moderators or Editors.
I don't recommend using a property to break out traffic on the same domain. It's better to use a new view with a filter. Be sure to keep a view that is unfiltered.
If you do decide to use a separate property, you will need to modify the code in all the page templates used in the /forum path to use a different UA tracking ID.
You can add a 2nd tracker for just the forum.
As per Google:
"In some cases you might want to send data to multiple web properties from a single page. This is useful for sites that have multiple owners overseeing sections of a site; each owner could view their own web property."
This exactly fits your scenario
See https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#multipletrackers

Best way how to track iframe separately from the site on the same domain

On my site I have feature for users, that they can embed video on their page with iframe. Now I'm tracking classic page view and iframe view same way. So my analytics stats are not correct. I wanna separate this tracking to know how much of visitors I have on page and how much of them on iframe. I'm using google analytics.
I'm looking forward what do you suggest.
BTW: I am using special url for embeded video but still on the same domain.
Since you've got a special URL for the embedded video, you could use filters to include or exclude that URL for a Google Analytics profile, and keep the same analytics code on every page.
I'd recommend:
Keeping one profile unfiltered, showing all traffic
One profile that filters out the iframe URL
One profile that only shows the iframe URL
More info about Google Analytics accounts & profiles
Can you add a simple GET-Parameter in your URLs? For example: http://www.website.com/video.flv?type=embedded
or
http://www.website.com/video.flv?type=extern
Unfortunately I don't know exactly, how Google Analytics handles same URLs with various GET-Parameter.
Other way is using a simple redirect script or htaccess rule.

Google Analytics - only track traffic to a folder of the site

I want to track traffic for mysite.com/current-campaign/ and careless about traffic on mysite.com in general.
Is it ok to place the GA tracking code in the files inside the /current-campaign/ folder or does it HAVE TO be in the root of the server for tracking to work?
GA will only track on the pages you actually put the tracking code on, regardless of where the page is located (unless you start messing with things like domain settings or filters etc..).
So IOW yes, it is okay to do that. If you don't have tracking code on mysite.com/somePage.html then it's not gonna track that page (though it might show up as the URL in some reports like referring URL or exit link or whatever, same as any other page you don't track)
In Google Analytics, you can add a filter to the profile and filter all but the chosen directories. Go to Analytics Settings > Profile Settings and look for "Add Filter" link.
In addition to Crayon's answer, you can limit tracking to a subdirectory by using _setCookiePath() function in your tracking function. See Analytics documentation on single subdirectory (note the link anchor is not resolved to a correct header, at least for me).
This is advised in the documentation to use when you only want to track a subdirectory and avoid clashes with Analytics trackers possibly in use in other subdirectories.
I work for a department in a large university.
The department's web page resides at www.some-uni.com/department-name/.
I only have FTP access to the sub-folder /department-name/ and nothing else on the site.
It was quite easy to get Google Analytics to track traffic within the subfolder /department-name/, ignoring the rest of the site. All I did was create a profile in GA, setting the default url to www.some-uni.com/department-name/. I then pasted the tracking code into the pages I wished to track.
It took about eight hours for anything to show up in GA, but after that it worked just fine.

Google Analytics appending index.cfm to end of my URLs

For some reason Google Analytics is appending index.cfm to the end of all of my URLs when I look at them in GA. The domain used to be ColdFusion based, but is now a WordPress PHP website running on an Apache server without ColdFusion installed.
We've added new pages to the website, and GA is still reporting an index.cfm at the end of the URL, even though that page never existed on the old ColdFusion site.
I didn't set up the GA account initially, is there maybe a setting that was enabled? Or does it take GA a while to figure out it's not a ColdFusion website anymore?
By the way, the website in question is http://www.westgatereservations.com. Thanks.
--ADDED--
Screenshot of page list from Google Analytics. All of these pages are WordPress PHP pages that use a clean permalink URL structure.
This is Google Analytics's 'Default Page' feature. If you go to the Account Settings and Edit the Profile Information, you'll see there's a field called "Default Page". It basically does what the theoretical filter I described above does: it automatically appends the default page (in this case, index.cfm) onto every page URL that doesn't have a page suffix. It's a shortcut, since most of the time, users want /foo and /foo/index.html to be counted as the same thing. But it totally breaks on WordPress and 'prettified' URLs, since they don't have a file suffix.
Just remove the Default Page (leave it blank) and the problem should be resolved. I'm not sure if it will be retroactive (Google Analytics rarely allows retroactive changes), but it will resolve the problem moving forward.
Read more about Google Analytics Default Page

AdSense: How to keep Ads updated with logged in user content

I want my Ads to work like Gmail, so it will show Ads according to the content of the user. All the users on my site have to login to insert content.
I use AdSense site authentication and it works fine, I can see the crawler reading the pages.
I configured my site the following way:
Every time the user redirects to a page I added his ID so the request is : X?id=123
And when the crawler user entered the same page, it shows a list of links to the same page with different IDs (each link shows different user content according to the ID) :
X?id=1
X?id=2
X?id=3 ….
It worked great !! If for example the user entered cars content he got cars Ads.
But after a while it stopped working, Even though the crawler keeps reading the pages the Ads aren’t relevant to the user content.
Is there a way to keep updating the Ads? (The content the crawler sees keep updating)
Is there a better way of doing this?
I use: ASP.NET MSSQL 2005
Thanks
Can a non-authenticated, non-javascript-running Bot that google is running see the context on these pages? Use Google Webmaster Tools (tutorial) to learn exactly what the googlebot sees on your site.

Resources