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?
>