Open GoogleCodeExporter opened 9 years ago
The javascript version of Google Analytics functions this same way, that is,
cookies
with the same domain are shared across multiple accounts (UA-XXXXX-1 and
UA-XXXXX-2,
or even UA-XXXXX-1 and UA-YYYYY-1).
Not that the flash version has to mirror the javascript version in every way,
but it
may be something to keep in mind.
Original comment by ja...@roirevolution.com
on 2 Dec 2008 at 2:16
In the current GA implementation, Flash shared objects are set and read by the
domain
that sets them. By default the shared object is set on the root of the domain
and
indeed have two swfs from the same name will lead to collision. As was
mentioned this
is the same as in the ga.js code.
You can use the _setCookiePath("/path") method to set multiple cookies on
different
paths within the same domain.
As it's working as expected, I'm closing this technical issue. If you have more
questions, please continue the discussion in the developer group.
Original comment by Nicksk...@gmail.com
on 2 Dec 2008 at 5:22
Sorry just before this is flagged as invalid lets look at why you need to track
flash. Flash is a different beast to HTML and JS as it is shared around
multiple domains
The difference between flash and JS is that no one takes your html pages and
hosts
them on their site. However with flash game this is a common occurrence. So if
a game
we make for a client is then hosted (ie swf taken and uploaded to their site) on
addictinggames.com along with several others from other agencies the cookie
will be
shared across them all. One flash cookie for all the games on the one site
regardless
of whose GA-ID has been entered.
The unique visitors is going to get majorly muddled and become irrelevant. This
is
different to tracking widgets and others like that where the swf URL is usually
the same.
Original comment by mrtruf...@gmail.com
on 2 Dec 2008 at 10:08
This is really good discussion and I can think of several features that would
accomplish this.....do you mind if we continue in the developer group so others
can
weigh in on the solution?
http://groups.google.com/group/ga-for-flash
This is all very good.
Original comment by Nicksk...@gmail.com
on 3 Dec 2008 at 12:53
proposition:
add an option in Configuration
Configuration.sharedCookie = true | false
when Configuration.sharedCookie == true
we keep the current behaviour
SO saved in "/analytics.sol"
and the user can change the path to /appname/analytics.sol
when Configuration.sharedCookie == false
we will save the SO in "/[hash_of_UA_id]_analytics.sol"
ex:
UA is "UA-111-222"
hash would be "136636820"
the SO path then would be "/136636820_analytics.sol"
if the user use setCookiePath()
for ex: setCookiePath( "/appname" )
the SO path would resolve to "/appname/136636820_analytics.sol"
different implications:
a) the Buffer class would have to check for both SO
try to get "/136636820_analytics.sol"
if not found try to get "/analytics.sol"
if not found then create the SO
b) the order of SO checks should be independant of sharedCookie option
even with Configuration.sharedCookie = false
we would still check for the presence of "/136636820_analytics.sol"
c) it is preferrable to use a hash then to use the real UA id,
the same UA id would always generate the same hash off course.
problems:
a) which SO should take precedence
if both "/analytics.sol" and "/136636820_analytics.sol" exists ?
b) if we find both SO, should we destroy the reductant one ?
c) what would be the implication with the API call cookiePathCopy() ?
planed for v1.1, but could be postponed to a v1.1.1 later build
Original comment by zwetan
on 3 Dec 2008 at 11:29
Original comment by zwetan
on 3 Dec 2008 at 11:30
Hashing the SO filename looks like the best solution here. You can only set the
path
in a directory the SWF is being hosted from so it's not a complete solution for
distributed content.
Per the problems, I'd suggest:
a) /hash_analytics.sol takes precedence
b) if we find both, we only look at the hashed version.
c) If we only see analytics.sol, we don't know which account id it belongs to
so we
can't delete it. Instead we can create the new /hash_analytics.sol file and
start
using it.
d) cookiePathCopy() should move all the contents from one analytics SO to
another
Original comment by Nicksk...@gmail.com
on 6 Dec 2008 at 9:24
Hey guys
I only got around to testing this now and the setcookiepath doesnt seem to work
http://bannerblog.com.au/banners/wolv/google_a_testing_events2.swf
Ive set the cookie path like so
var googleA:AnalyticsTracker = new GATracker( this, "UA-903174-61", "AS3", true
);
googleA.setCookiePath( "/testGoogleA222" );
and I just end up with the same "analytics.sol" on my site.
Same thing for localhost testing.
I was expecting testGoogleA222.sol or a folder within this but no?
I was going to embed this in the page but flash creates shared objects anyway
Original comment by mrtruf...@gmail.com
on 4 Jan 2009 at 11:30
setCookiePath was fixed here :
http://code.google.com/p/gaforflash/issues/detail?id=28&can=7
It's not in the current release, but avaliable if you download and link the
source in
your project. This only solves the changing of the directory that the .sol is
set on
(which also has it's own set of restrictions)
Modifying the SO name is still a new feature that would need to be built.
I'm curious how much of an issue is cookie collision. If you have
setCookiePath, the
only time cookies would collide is if somebody actually copied the SWF and
hosted
from their own domain. How often does this occur? .01%, 1%, 10% of the time?
Original comment by Nicksk...@gmail.com
on 5 Jan 2009 at 5:27
Cookies colliding (sic) is not a problem for sites or widgets.
It is a problem for flash games. As mygame.swf might be copied and put in
addictinggames.com
same with anothergame.swf from another developer
I might also have two games Ive done for different clients both on the same
site.
They cookies need to be seperate.
that's the main concern I have now
Original comment by mrtruf...@gmail.com
on 5 Jan 2009 at 6:58
Original issue reported on code.google.com by
mrtruf...@gmail.com
on 2 Dec 2008 at 10:31