When using Google Analytics and using the newer ga.js file, is the __utm.gif file needed in your root directory of your web site?
I do see a call being made from my browswer to the file on google-analytics.com (http://www.google-analytics.com/__utm.gif?...), but in the past I was told that it needed to exist in the root of the site.
Does this still hold true?
Could you please provide a reference?
If you are using the new version of the tracking code (ga.js), the only thing you need to do is include this snippet of JavaScript:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
</script>
This would imply that there are no requirements for you to host any __utm.gif file on your server (I'm not sure how this would even work for analytics anyway, as the whole point is for the client's browsers to make requests to Google's servers).
I use the older urchin.js tracking mechansim and there are no requirements to host anything locally although you can put the .js file on your server for speed. There are four images that get requested to provide the tracking; __utma, __utmb, __utmc and __utmz which correspond to they cookies recorded of the same name.
From Google; When you first begin implementing tracking in Google Analytics website, you need to install the tracking code on your website pages. The generic tracking code snippet consists of two parts: a script tag that references the ga.js tracking code, and another script that executes the tracking code.
You are required to add _utm.gif to your server root if you are also sending a copy of the google analytics data to your local webserver. It gives you the option of keep the data much longer since Google is only keeping 25 months of data for free account.
Google also doesn't share the raw data, the only way to get the raw data is also sending it to your local webserver log. For it to work, you need to add this line below to the tracking code:
_gaq.push(['_setLocalRemoteServerMode']);
For more detailed discussion, please refer to the book by Clifton, Brian (2012-03-30). Advanced Web Metrics with Google Analytics (Kindle Locations 4459-4460). John Wiley and Sons.
Related
I'm using the Google Analytics's gtag.js on a single-page webapp (SPA). As suggested in the docs for SPAs, I've disabled the automatic send_page_view and instead explicitly send a page view by setting a page_path and page_title to the gtag config. So far, so good.
The docs also list an optional page_location parameter to send the page's full URL. For my app's search page, I'm particularly interested in getting the full query params after the ? in the URL, so I tried adding it to that payload:
gtag('config', GA_TRACKING_ID, {
page_location: window.location.href,
page_title: 'app search page',
page_path: '/search',
});
However I never see a full URL in either the Anlaytics web UI or in its export to BigQuery. I only the page_title and page_path. Where does page_location end up getting stored or reported?
page_location is not reported in Analytics but might be used for processing source and medium parameters and for extracting page_path if not provided.
I am getting this error when trying to load google maps
Google Maps API error: MissingKeyMapError
I am accessing the application on my localhost http://localhost:3000/
After googling I noticed that an API key needs to be passed to resolve this error, but how do I pass this key? I don't see any attributes related to this key for sebm tag.
Party-detail.html has the following:
<sebm-google-map
[latitude]="lat || centerLat"
[longitude]="lng || centerLng"
[zoom]="8"
(mapClick)="mapClicked($event)">
<sebm-google-map-marker
*ngIf="lat && lng"
[latitude]="lat"
[longitude]="lng">
</sebm-google-map-marker>
</sebm-google-map>
You may place following the script in your index.html file
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_API_KEY_HERE"></script>
before
<script src="build/js/app.bundle.js"></script>
and you may manage an api key form
https://developers.google.com/maps/documentation/javascript/
I use google scripts to fill Google Spreadsheet by Google Analytics data.
Problem: I get error: Login Required when I call =getCountOfNewUsers(B1,B2) from my Spreadsheet file. NOTE: when I run runTest() from google script project everything working OK.
FYI: I have followed this tutorial.
function runTest() {
try {
var results = getCountOfNewUsers(new Date(), new Date());
Logger.log(results.totalsForAllResults["ga:newVisits"]);
} catch(error) {
Logger.log(error.message);
}
}
function getCountOfNewUsers(date_from, date_till) {
date_from = Utilities.formatDate(date_from, 'GMT', 'yyyy-MM-dd');
date_till = Utilities.formatDate(date_till, 'GMT', 'yyyy-MM-dd');
var tableId = 'ga:*****';
// Make a request to the API.
var results = Analytics.Data.Ga.get(tableId, date_from, date_till, 'ga:newVisits', {});
if (results.getRows()) {
return results;
} else {
throw new Error('No views (profiles) found');
}
}
This is not solution to your question but it directs you to easy better solution to your problem if your interested!, you can easily setup this solution in an hour!
Details:
Better Than A writing our own script with Diligent Study and make Google scripts to fill Google Spreadsheet by Google Analytics data I use this Google Analytics Report Automation (Magic Script)
This Magic Script allow you to simplifies this process and makes it
easy to get the data you want so that you can focus on analysis and
reporting.
Custom API Dashboards - No Code Required it will save your burden for
Writing Your Own Script.
About the Error Try following things
Go to script editor, click on Resources > click on Use Google APIs.
Click on "Google APIs Console".
select APIs & auth > click on Registered apps.
Do Register your script project as web application.
select Certificate > Generate New Key .
This is an expected behavior. Custom Functions cannot ask users to give access to personal data. So they are not suitable for all types of services, specifically those which need authorization for personal data.
Check this url to know which services you can use - https://developers.google.com/apps-script/guides/sheets/functions#using_apps_script_services
Unlike most other types of Apps Scripts, custom functions never ask users to authorize access to personal data. Consequently, they can only call services that do not have access to personal data
I have a single page app that uses Google Analytics. The account key and domain change per-environment because the tracking is meant to be segmented by environment so the setup is somewhat involved.
I would like to be able to verify that the _gaq object has my account key as expected and that is has the domain name set as expected. When I run the code google provides to get the account key, I only get back A-XXXXX-X.
_gaq.push(function() {
var pageTracker = _gat._getTrackerByName();
console.log(pageTracker._getAccount()) // Logs UA-XXXXX-X, not my actual number
});
What is the right way to verify the correct configuration of the _gaq object?
You can verify correct configuration by running these commands in console:
ga(function(tracker) {
console.log( tracker.get('trackingId') )
console.log( tracker.get('cookieDomain') )
});
This will log out the tracking ID and domain google is expecting you to track against. If the configuration is set up correctly, these values will be what you have configured.
I am trying to develop a “connect with facebook” with ASP.NET 3.5 and have followed lots of articles but I am not able to get it working. Most of the developers who spoke about this matter end up referring to the below article:
devtacular.com/articles/bkonrad/how-to-retrieve-user-data-from-facebook-connect-in-aspnet/
I followed that article, but the only thing I was able to get working was checking the authentication status of the current user:
devtacular.com/articles/bkonrad/how-to-integrate-with-facebook-connect/
However, trying to read users’ data gives me the following error all the time (although the same key was used in the previous successful test! - checking the authentication):
Invalid API key specified
The app you are trying to access does not exist or has been disabled.
The link to the 2 pages I developed are below, you may try them to see what I have done:
http://www.myifaworld.com/desktopModules/facebook/connect.aspx (the connect method - works fine)
http://www.myifaworld.com/desktopModules/facebook/bkonrad_1.aspx (reading users data - error)
I basically want users to click on the “connect with facebook” on my page to login using facebook and my code reads users’ info and save the users’ basic information to my database.
Any help is highly appreciated!
Checked your both pages
Your user data page gives below error.
FB.Event is undifined.
and also you dont have the refeence to the fb script above your code.
try adding these lines in your code above FB.Init
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
Read my blog for deail facebook connect integration
http://codethatworkedforme.blogspot.com/2011/08/facebook-connect.html