Finding out where my swf is hosted

9 views
Skip to first unread message

ejm

unread,
Jun 8, 2009, 4:19:00 PM6/8/09
to GA Tracking For Adobe Flash, da...@omgpop.com
I am currently using ga tracking for flash to host my embedded games.

We are getting events and page views and everything is working great,
but we are not sure where to look to get better data on where the swf
is being embedded.

We will have big spikes in traffic on our widget, but all the
referring traffic sources will typically appear as direct.

but the swf is hosted on say, onemorelevel.com or newgrounds.com.

is there any way i can get at this information about the html page
doing the embed?

e.j.




ejm

unread,
Jun 8, 2009, 4:21:15 PM6/8/09
to GA Tracking For Adobe Flash
ewps... that should say: i am using ga for flash to TRACK my embedded
games, not to host them.

Aran Rhee

unread,
Jun 8, 2009, 8:04:06 PM6/8/09
to ga-for...@googlegroups.com
I'm sure the Google guys can give you a better answer, but don't you get referrer data in your Google analytics ?
 
Maybe this article will help:
 
 
Aran

ejm

unread,
Jun 8, 2009, 11:23:51 PM6/8/09
to GA Tracking For Adobe Flash
Thanks aran,

approach #1 from that article looks cool. i dont think we could do #2
since we dont have access to "document.referrer" from flash as
javascript allowScriptAccess is usually cut off on embedding sites.

but the problem is that in analytics it shows 90% of the traffic as
direct. so we dont have that many 'referrers' even though this is all
embedded content.

i assume this means the referrers to the embedding site are ignored by
our own analytics, and the embedding site does not register as a
referrer... perhaps since they dont actually 'link' to us.

that info must exist somewhere tho???

surely lots of people are using ga for flash for this type of thing,
so hopefully someone has this info.

e.j.


On Jun 8, 8:04 pm, Aran Rhee <aran.r...@gmail.com> wrote:
> I'm sure the Google guys can give you a better answer, but don't you get
> referrer data in your Google analytics ?
>
> Maybe this article will help:
> *http://www.reubenyau.com/google-analytics-hack-obtaining-full-referri...
> *<http://www.reubenyau.com/google-analytics-hack-obtaining-full-referri...>
>
> Aran

zwetan

unread,
Jun 9, 2009, 9:12:48 AM6/9/09
to GA Tracking For Adobe Flash
hi,

>
> approach #1 from that article looks cool.  i dont think we could do #2
> since we dont have access to "document.referrer" from flash as
> javascript allowScriptAccess is usually cut off on embedding sites.
>

the only way to obtain the referrer is to get it from
document.referrer
using the ExternalInterface

flash in itself does not have access to this information


> but the problem is that in analytics it shows 90% of the traffic as
> direct. so we dont have that many 'referrers' even though this is all
> embedded content.
>

that's normal, because when allowScriptAccess=false
we can not get the info of the referrer from ExternalInterface
so the referrer=""


> i assume this means the referrers to the embedding site are ignored by
> our own analytics, and the embedding site does not register as a
> referrer... perhaps since they dont actually 'link' to us.
>

how the game is embed in this other site ?

> that info must exist somewhere tho???
>
> surely lots of people are using ga for flash for this type of thing,
> so hopefully someone has this info.
>

we're thinking of maybe allowing to override the referrer for those
kind of cases,
but not sure if it will actually make it in a next release

but we re aware of the problem

zwetan

ejm

unread,
Jun 9, 2009, 11:56:57 AM6/9/09
to GA Tracking For Adobe Flash
here is an example...

morganducks

unread,
Jun 9, 2009, 3:09:04 PM6/9/09
to GA Tracking For Adobe Flash
I'm having this exact same problem. I want to know who's using my
embed code.

Can someone please post an example of using the externalInterface with
google analytics? If I read this right, externalInterface will read
the URL of the page where the user is seeing the SWF?

FYI, I have my allowScriptAccess turned to "always" in the embed code,
so I think EI should work.

Here's my AS3 code:

import com.google.analytics.AnalyticsTracker;
import com.google.analytics.GATracker;
var tracker:AnalyticsTracker = new GATracker( this, "UA-xxxxxxxx",
"AS3", false);

//functionality for start button
sensor.addEventListener( MouseEvent.MOUSE_OVER, startExample );

function startExample( event:Event):void {
//we know that the user engaged the flash movie (they clicked start)
tracker.trackPageview("/GAFlash/Start");
}

stop();
> > zwetan- Hide quoted text -
>
> - Show quoted text -

andres solis the indestructible

unread,
Jun 9, 2009, 3:14:22 PM6/9/09
to ga-for...@googlegroups.com
if i'm not mistaken this will only report if the google code is on the hosting page as well, not just in your swf.  can some shed some light on this?

ejm

unread,
Jun 9, 2009, 4:17:24 PM6/9/09
to GA Tracking For Adobe Flash
morganducks...

in an ideal world, you could go like ExternalInterface.call
( "window.location.href.toString" );
then you could track that value with the event tracker.

but most game sites and myspace will turn off allowScriptAccess.... so
you could track it on someone that does not know to turn this off, but
not in the most fruitful places.

this kind of security solves a fairly serious exploit where embedded
swfs could execute random javascript on pages.

e.




On Jun 9, 3:14 pm, andres solis the indestructible
<itsforand...@gmail.com> wrote:
> if i'm not mistaken this will only report if the google code is on the
> hosting page as well, not just in your swf.  can some shed some light on
> this?
>

morganducks

unread,
Jun 10, 2009, 11:48:36 AM6/10/09
to GA Tracking For Adobe Flash
Thanks for the responses guys. EJM, do you have an example of the
ExternalInterface.call code? Most of the sites that will be embedding
this code are small businesses, thus probably won't have this feature
blocked.

Andres, from what I understand, what I'm trying to do is not exactly
what gaforflash was supposed to do.
> > > > - Show quoted text -- Hide quoted text -

Nick

unread,
Jun 10, 2009, 1:13:07 PM6/10/09
to GA Tracking For Adobe Flash
Hi Guys,

So here is a full explanation of whats going on. As Zwetan mentioned
we looked at this in the past.

If you have access to external interface, you can get the domain the
SWF is embedded on by looking at the Javascript's document.referral
property. The gaForFlash uses JavaScript injection to actually write
JavaScript code from the flash tracking object into the containing
HTML page to obtain this value by default.

The issue arises if you don't have access to external interface. The
Flash player security sandbox explicitly does not allow a SWF to know
the URL of the page it's embedded on. This is the same issue as with
other tracking solutions like Mochi Bot. Though there are some ways
around this.

If you can give end users an embed URL, you could embed the SWF in an
iFrame. An iFrame's document.referral is the page it is being
displayed within. Since you control the iFrame you could then allow
script access in your SWF and there would be a way to pass back
referral info to the tracking object. (though there needs to be some
additional logic implemented to override the existing login of where
gaForFlash gets it's referral)

If you host all instances of the SWF, another option is to have the
SWF file actual do a server redirect to a script which would capture
the URL that made the original request and inject that data back into
the SWF before you serve the content. This is the solution companies
like ClearSpring implement in their widget tracking product. (this can
also work for gaForFlash but some code changes would need to happen)

The final case is if you don't host the SWF and allow script access
has been disabled. There is no solution for this as Flash player
doesn't allow you to know the domain the SWF is on in this case. If
somebody has a good solution that is overlooked above, please let us
know!

-Nick



On Jun 9, 12:14 pm, andres solis the indestructible
<itsforand...@gmail.com> wrote:
> if i'm not mistaken this will only report if the google code is on the
> hosting page as well, not just in your swf.  can some shed some light on
> this?
>
Reply all
Reply to author
Forward
0 new messages