I'm feeling the topic isn't the best one, but here goes.
I've made a flex 3 app that is sitting on my we开发者_运维问答b server. People will be able to link to this flex app on my web server on their own sites/blogs/forums and so on.
Is there any way I can log where a user that clicks on it comes from?
Example:
the URL to the flex app is http://www.myflexapp.com/flex/app.swf
User A links the flex app at his blog at http://www.wordpress.com/SomeDudesBlog
Then User B comes in to User A's blog and clicks the flex app and finally ends up at my site.
Any way I can log User B's click through the flex app?
I hope you understand what I mean, I'm having trouble explaining :(
The absolute easiest way to do this and get good metrics on it are to have people link to an html file that embeds the swf(not your swf directly) and set up analytics software like google analytics to monitor the page. Youll get all kinds of statistics along side their referring page. This of course is of no use for getting the referring page inside of flex for whatever reason but is perfect for logging.
If you didnt want to set up google analytics, or you want something more light weight, you can create a script in any language your server supports to set up some simple logging.
You could use ExternalInterface (flash.external.ExternalInterface) from Flash to call a javascript function which would get the value of document.referrer and return it to your flex app.
See http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html
精彩评论