为 Actionscript 2 实施 google 分析跟踪的最佳方法是什么?
我正在寻找代码、示例、库、组件,以便在我的 Actionscript 2 Flash 电影中使用 Google Analytics 事件跟踪。我可以在 google code 网站上找到有关 AS3 的信息,但找不到 AS2 的信息。关于标记我的 Flash 文件以使用异步谷歌分析代码的教程和示例的最佳资源是什么。我发现了一些关于旧谷歌分析代码的旧信息。
谢谢
I am looking for code, examples, library, components for using google analytics event tracking with my Actionscript 2 Flash movies. I can find info about AS3 on the google code site but not AS2. What is the best resource for tutorials and examples about tagging my Flash files to use the asynch google analytics code. I have found some old information about the old google analytics code.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我必须对 AS2 项目进行大量维护,所以我知道你来自哪里。我的做法如下:
第 1 步是在 HTML 中设置一个可供 Flash 电影使用的 google 分析跟踪信标。 Google 有如何执行此操作的示例,但这里是我最近所做的设置示例:
在页面上设置信标后,您现在可以使用ExternalInterface 让 Flash 影片向 google 发送跟踪消息。在 Flash 的某个地方,您需要一个可以从代码中的其他位置调用的函数,如下所示:
当您想要跟踪事件时,您可以传入一个使用 google Analytics 语法准确描述该事件的字符串。例如:
/root/loadingFinished
或类似的内容。希望这有帮助!祝你好运!
I've had to do a lot of mainenance on AS2 projects, so I know where you're coming from. Here's what I do:
Step 1 is to get a google analytics tracking beacon set up in your HTML that your flash movie can use. Google has examples of how to do this, but here's an example of a set up that I did recently:
With the beacon set up on your page, you can now use ExternalInterface to have your flash movie send tracking messages to google. Somewhere in your flash you'll need a function that you can call up from anywhere else in your code that looks like this:
When you want to track an event, you pass in a string that accurately describes the event using google analytics syntax. Ex:
/root/loadingFinished
or something similar.Hopefully this helps! Good luck!
我已将其添加到我的 Flash 项目中,到目前为止似乎可以正常工作。我还没有留下足够长的时间来检查谷歌分析报告中的情况,但我将用所发生的情况更新这个答案。
I have added this to my Flash projects and it seems to work so far. I have not left it long enough to check what has come through on google analytics reports yet but I will update this answer with what comes through.