Is there a lighter version of Google Analytics for Flash - apache-flex

40k of compiled code seems like a lot to me to be making some straightforward flash-javascript calls and makes GA unsuitable for banner ad work as well.
Does anyone know if there is a 'lite' version of Google Analytics for Flash?

How about using directly the javascript functions? say:
ExternalInterface.call("pageTracker._trackPageview", "section/subsection");
ExternalInterface.call("pageTracker._trackEvent", "event", "cat", "label", "value");

I don't believe there is a lite version, similarly i don't believe google analytics intended its service be used for ad tracking. That being said, you should try compressing your swf. You can often shave off a big chunk of the file size especially from text source files.
http://www.compress-swf.com/
http://www.softpedia.com/get/Internet/WEB-Design/Flash/swf-compressor.shtml

Cay
That should work but how would you pass your custom account ID?
ie
If using the GATracker object
var myTacker=GATracker(containerdisplayObject,'customaccountID','Bridge',false)

Depending on what you are trying to track, why not just have the flash call home. Posting some variables to a script that loads them in a database?
var counter:LoadVars = new LoadVars();
counter.gamename = gametitle; //set variables here
counter.sendAndLoad("http://your script", result_lv, "POST");

You will need to perform an ExternalInterface call from the flash back to the containing page.
Once you are back in the javascript you can use the javascript library that google provides to send custom events and page views back to google analytics.
It's important to distinguish between tracking events (typically a file download, a video being played, etc...) and pageviews. If you want to track navigation within a flash movie between different "pages" of flash content then you will probably want to use:
var pageTracker = _gat._getTracker('UA-XXXXX-X');
pageTracker._trackPageview('/flash/my_first_page');
Note that this will contribute to your overall page views count.
From google:http://code.google.com/apis/analytics/docs/tracking/asyncMigrationExamples.html
Use the _trackPageview() method along with a URL you fabricate in
order to track clicks from users that do not lead to actual website
pages on your site. In general, we recommend you use Event Tracking
for tracking downloads, outbound links, PDFs or similar kinds of user
interactions. This is because virtual pageviews will add to your total
pageview count. However, if you want to configure goals based on
clicks to PDFs or downloads, you need to use this method (but be aware
that these clicks will be tallied as part of your overall pageview
count).

Related

Google Analytics API For getting total clicks and impression on element

I am really new to Google Analytics and I had a requirement of tracking clicks and impressions. I followed following link
http://www.statstory.com/tracking-clicks-and-impressions-in-google-analytics/
and sucessfully implemented the same.
Now my requirement is to get the no.of clicks and no. of impressions
to my html page. I am googled for past quite hours but couldnot find
any luck with the same.
Any help would be highly appreciated.
You should really consider implementing Google Analytics Enhanced E-commerce functionality.
Google Analytics Enhanced E-commerce
In regards to answering your question of the API, you should query it asking for events. Namely category, action and label events and apply a filter to only return the data you wish to receive, such as 'Impressions' as a filter for 'Event Action'. That will return all impressions and if you instead change the filter to use 'Click', you'd get all clicks instead.
If you followed the above guide and made it into Universal, then you'd see the calls you set and it is set up in the following way:
_gaq.push(['_trackEvent', 'Banner', 'Click', 'BANNERNAME',1.00,true]);
This bit of code pushes (legacy version) Analytics data in the form of:
_gaq.push(['_trackEvent', 'Category', 'Action', 'Label',1.00,true]);
So, changing the different sections means you change how you define the data and how it will be visible in reports. Category defines the Event Category, Action defines the Event Action and Label defines the Event Label.
Take a look at the core development guide. Also, here you can see all the API calls available: Dimension & Metrics explorer for Google Analytics
I gather that you want to track impressions for banner advertising that is displayed by yourself (i.e. not through an adserver) in your website.
I agree with Mr Sponge that you should upgrade to Universal Analytics. if you want to implement enhanced e-commerce tracking (EEC) you probably want to read about Measuring internal Promotions, which is a feature specifically build for that kind of reporting.
If you just need the raw number of banner impressions and/or need a solution that's easier to implement (but less capable) you can increment a custom metric every time you banner shows up (this is basically a counter, you might want to use it together with a custom dimension that holds the banner name). Click tracking would still be done by events (with similar custom metrics and dimensions). From that data you can assemble a custom report and use a calculated metric for click through rates etc.
Not as good as EEC by a fair margin but much easier to do.

Preventing an iframe on the same domain from triggering a page exit in Google Analytics

I am working on a third party website that contains a web application embedded in an iframe on the home page. This iframe is hosted on the same same sub/domain.
Currently page views are being tracked with _trackPageview. Due to a requirement by marketing both pages use the same Google account Id.
Since the iFrame was implemented the marketing department has noticed that the bounce rate has dropped to almost nothing. I suspect that this is because Google is interpreting the pageView event on the iframe as the visitor hitting another page on the website.
Just for additional information, the domain of the _gaq object is being set to "none" for both the container page and iframe.
Does Google provide a mechanism by which you can trigger PageView in such a way that it isn't interpreted as subsequent pageview in this scenario? (I know that trackEvent has a noninteraction property to deal with this?)
Am I better off just disabling the PageView for the default iframe page?
Does Google provide a mechanism - apparently yes, but probably not for your use case.
The field documentation for Universal Analytics describes the non-interaction field thusly:
Specifies that a hit be considered non-interactive.
So in UA this does no seem limited to events but to apply to all hits (which would include pageviews). I want to point out that I have no tested it and that it seems counterintutive, so it might simply be that the documentation is incomplete/wrong here.
However as you are using "classical" Analytics this does not apply to you. Since upgrading the code is a good idea in any case you might want to push for an update to Universal Analytics (this piqued my curiosity so I will test this over the next few days and update this answer with the results - maybe you want to wait until then, or simply test it yourself).
It's possible, but not 100% clear to me that disabling the PageView event on the iframe will prevent your users from registering a page exit (the pageview may get recorded regardless). You can try removing that event and see if it works.
But a better way may be to implement a custom filter on a new View excluding traffic to that specific class of iframes. Make sure you keep your old View (or create a new one with further filters) to make sure you're capturing those iframe views, if you think that's necessary.

How to use analytics screenviews in a website?

I'd like to track screenviews in my website, is this possible or are screenviews just meant to be used on apps? If so, how can I do it? Let me give you an overview of my situation.
I am restructuring a web site. Some of the pages that used to live under differents urls are now living under the same, with a hash id to denote the particular area of the page the user is in. So, for example, http://www.example.com/topics/topicA, http://www.example.com/problems/topicA and http://www.example.com/equations/topicA, are now in http://www.example.com/topics/topicA#content, http://www.example.com/topics/topicA#problems and http://www.example.com/topics/topicA#equations.
Now, I'd like to keep track of users visiting these areas. My initial idea was send a page view when the url is loaded and send a screenview each time the user clicks on the button to change the area of the page (i.e. #content, #problemas or #equations). For doing so, I used something like ga('send', 'screenview', {'screenName': 'content',});. As I couldn't see the screenviews in reports, I played a bit, setting the app name, the app id, the installer id etc before sending the screenview, for example:
ga('set', {
'appName': 'myAppName',
'appId': 'myAppId',
'appVersion': '1.0',
'appInstallerId': 'myInstallerId'
});
ga('send', 'screenview', {'screenName': 'content',});
So I can't see the screenviews in the real time reports (though I can see the page views). I can't see them in the regular reports either. I decided to create custom reports with dimensions Page and Screen name. There, I see sometimes screenviews are tracked (I think it happens when I set the appid etc before sending it, but not sure about this point).
Are screen views adecuate for tracking this behaviour or should I use just events, as I'm not on an app at all (just a responsive website)?
By the way, I am using Drupal 7 but that shouldn't make a difference.
Thanks in advance for your time and I hope I am making my question clear enhough.
Technically speaking its probably possible to send both pageviews and screenviews to the same Google Analytics web property.
The problem you will have is seeing the information. The way the Website is set up its either application or web account, Screenviews or pageviews. The reports are different, and you cant swap between them.
So you could send screenviews to a web site web property but you would never be able to analyse it on the website you would have to use the API to rip the data out. That and you would be analyzing apples and cars. Screenviews and pageviews are different they cant be analysed together.
Because of this web property's should be kept separate one for application (screenviews) one for web sites (pageviwes).
You should in my opinion do this using events.
+1 for an interesting question that made me think :)
Is possible, actually in BigQuery you can reach both data and see how this interact, both will have the same schema and will be stored in the same dataset(it is linked the raw data view). Even in the same sessions, you can send pageview and screen views having funny results.
But there is some important consideration when you implement this.
You need 2 different views, one Web View and One App View. Both views will let you access to different information and is not possible on the web interface of Google Analytics to access to both info at the same time. Not sure if with the API you can access to both info at the same time, I think that is totally possible
In the App View, you will able to see only information of screenview, events and ecommerce.Is also mandatory the App Name parameter on this hits.
In the Web View, you will able to see only the pageview reports,events and events.
The ecommerce info and events will be reachable from both views, there is no way to know if this comes from a web or an app ( technically). So is tricky to read this kind of reports in that case.
Sessions can experiment stranges behaviors. As example gosht sessions coming from the screen view with no page view, sending events.
Taking this into consideration, as Dalmto says, the best to you is use events or sent virtualpage view.
Mixing pageview and screen view is not recommended by Google but is totally possible.This kind of implementations is only useful when you have an embed web-app and a webpage on the same server and you want to have it all on the same dataset, if this case apply, is highly recommended to add a custom dimension to filter the app info on the web view and the web info on the app view and keep both worlds separated.
As the last point, your code is working, I can see the screen info on the desktop property. But not be able to see it in the web view.

Track links with Event or Query strings with Google Analytics

I am using Google Analytics and would like to see how users interact with my site, mainly what internal links they are clicking and from where.
One approach I've found is to add queries to my links like so ?ref=sidebar or ?ref=featured
Another approach is to use Event Tracking _gaq.push(['_trackEvent', 'Article', 'Click', 'Sidebar']);
I am wondering: Is there any reason to use one approach over the other? I know Event Tracking can be used to capture Javascript events, which queries cannot. But most sites I've seen also uses Event Tracking on their links, instead of simply adding a query string. Why is that?
Query Strings make different unique urls. So if you add query strings to your pages the pages report will show multiple entries for (basically) the same url depending on how people got there, e.g.:
subsite.html
subsite.html?ref=sidebar
subsite.html?ref=featured
each with it's own pageview count and other metrics.
Usually you do not want this. Event tracking is better since it does not blow up the url count (there might be be even better ways, especially if you upgrade to Universal Analytics and use custom dimensions).

Can Google Analytics track Custom Events from an AdWords Flash Banner?

i know it can track flash events from other flash banners/sites on other networks..
but can it from Adwords?
i found this code:
on (release) {
// Track with no action
getURL("javascript:pageTracker._trackPageview('/folder/file.html');");
}
but it seems to require a JS script on the page.
how does Adwords handle this?
thanks
-art
It should be fairly easy to try this and upload a banner to AdWords, but the following seems to imply that this is not allowed
http://adwords.google.com/support/aw/bin/static.py?hl=en&page=guide.cs&guide=28427&topic=28431
"Extra calls: Your ad code cannot make external server calls for additional JavaScript or other functionality. All functionality must be localized to the code itself. "
Also if you want to use Google Analytics within Flash, refer to the following documentation :
http://code.google.com/apis/analytics/docs/tracking/flashTrackingIntro.html
(in your case it sounds like Bridge mode is what you are looking for).

Resources