如何跟踪我在其他网站上嵌入的 Flash 视频播放器

发布于 2024-08-23 00:20:48 字数 442 浏览 10 评论 0原文

设置:

  • 一个在线电视频道,带有“youtube”之类的剪辑和类别
  • 我们自己的 flash 视频播放器,可以嵌入到其他远程站点
  • as2 flash 播放器

目标: 跟踪谁嵌入了我的视频,至少有每个域的基本统计数据。

由于是AS2,所以这样做比较困难。我的想法是我可以创建一个 PHP 页面,每次播放器加载到任何网站时都应该打开该页面;然后 Flash 播放器可以对包含 Google Analytics 代码或其他一些不错的跟踪器的 PHP 文件执行“geturl”。

geturl 命令可以包含一个变量,例如已经包含在播放器中的视频标题;这个标题将通过 GET 传递到 PHP 文件并设置一个可以很好跟踪的动态页面标题。

问题:如何在用户浏览器不打开新选项卡或窗口的情况下使用 GETURL 函数。有什么隐藏的方法可以做到吗?

Setup:

  • an online tv channel with "youtube" like clips and categories
  • our own flash video player which can be embeded into other remote sites
  • as2 flash player

Goal:
To track who's embedding my videos, at least with basic statistics per domain.

Since it's AS2, it's harder to do this. My idea is that I can create a PHP page which should be opened each time the player loads on any website; then the flash player can do a "geturl" of the PHP file which has Google Analytics code or some other decent tracker.

The geturl command could contain a variable like the Video Title which already is included in the player; and this title would pass on with GET to the PHP file and setup a dynamic page title which can be tracked very well.

Problem: how to I use the GETURL function without having user's browser open a new tab or window. Is there any hidden way to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

定格我的天空 2024-08-30 00:20:48

我发现的主要问题是,只有在 的 html 嵌入代码中有allowScriptAccess 时,才能存在对外部信息的控制,如下所示:

<param name="allowScriptAccess" value="always">

allowScriptAccess="always"

标签中。

这对我来说有点晚了,因为我不能告诉每个嵌入我的播放器的人将这些行添加到他们的网站,但从现在开始......无论如何,想要隐藏的人可以轻松删除这些行。 所以我重命名了 SWF 文件 ...现在每个进行远程嵌入的人都必须回来检查并获取新代码。

这是有效的 AS2 代码:

function geturlhttp() {
//urlPath = ExternalInterface.call("window.location.href.toString");
urlPath = ExternalInterface.call("eval","document.location.href");

//both work, try which one is bet
}
geturlhttp();


var lv:LoadVars = new LoadVars();

lv.var1 = urlPath;
lv.var2 = title; //an internal variable, the name of the file


lv.sendAndLoad("http://www.somesite.test/tracker.php",lv,"POST");

因此,跟踪仅适用于我自己的站点,不适用于 sql 中显示为空或“null”的外部远程嵌入站点。

这是我用 SQL 编写的 PHP 代码。我只做了一些用于插入的东西,稍后我将进行显示和选择......

<?php
//POST needs to be secured, this is just a test :)
$url = $_POST['var1'];
$title = $_POST['var2'];

$dbhost = "127.0.0.1"; // almost always localhost.
$dbname = "x";   // Database Name, In our case, its news
$dbuser = "x"; // Database Username
$dbpass = "x"; // Databse Password


$connect = mysql_connect("$dbhost","$dbuser","$dbpass");// Connecting to Database

mysql_select_db($dbname) or die (mysql_error()); // Selecting Database

$sql= "INSERT INTO tablename (urlrow, titlerow) VALUES ('$url','$title')";
$result = mysql_query($sql);

?>

The main problem I found is that control over the external information can only exist if there is allowScriptAccess in the html embed code of the , like this:

<param name="allowScriptAccess" value="always">

and

allowScriptAccess="always"

In the tag.

This is a bit late for me since I can't tell everyone who embeds my player to add those lines to their site, but from now on... Anyway, someone who wants to hide can easily just delete the lines. So I renamed the SWF file ... and now everyone who does the remote embed has to check back and get the new code.

Here's the AS2 code that worked:

function geturlhttp() {
//urlPath = ExternalInterface.call("window.location.href.toString");
urlPath = ExternalInterface.call("eval","document.location.href");

//both work, try which one is bet
}
geturlhttp();


var lv:LoadVars = new LoadVars();

lv.var1 = urlPath;
lv.var2 = title; //an internal variable, the name of the file


lv.sendAndLoad("http://www.somesite.test/tracker.php",lv,"POST");

So the tracking only works on my own site, not the external remote embedding sites which come up empty or "null" in sql.

And here's the PHP code I made with SQL. I've only made something for the insertion and I'm going to work on display and selection later...

<?php
//POST needs to be secured, this is just a test :)
$url = $_POST['var1'];
$title = $_POST['var2'];

$dbhost = "127.0.0.1"; // almost always localhost.
$dbname = "x";   // Database Name, In our case, its news
$dbuser = "x"; // Database Username
$dbpass = "x"; // Databse Password


$connect = mysql_connect("$dbhost","$dbuser","$dbpass");// Connecting to Database

mysql_select_db($dbname) or die (mysql_error()); // Selecting Database

$sql= "INSERT INTO tablename (urlrow, titlerow) VALUES ('$url','$title')";
$result = mysql_query($sql);

?>
淤浪 2024-08-30 00:20:48

最简单的方法是使用 LoadVars:

var lv:LoadVars = new LoadVars();

lv.var1 = "hostname";
lv.var2 = "browsersettings";

lv.send("http://yourserver/script.php, lv, "POST");

我不确定是否有任何沙盒限制。

The easiest way to do this is to use LoadVars:

var lv:LoadVars = new LoadVars();

lv.var1 = "hostname";
lv.var2 = "browsersettings";

lv.send("http://yourserver/script.php, lv, "POST");

I'm not really sure if there are any Sandbox-restrictions for this.

差↓一点笑了 2024-08-30 00:20:48

Salut Dan,

有一段时间没做as2了。

麻糬机器人
(来源:mochibot.com

我记得我用过mochibot,
您可以跟踪您的 swf,无论它在哪里
嵌入的。

他们可能仍然有 as2 跟踪。

Salut Dan,

Haven't done as2 in a while.

mochi bot
(source: mochibot.com)

I remember I used mochibot,
you could track your swf, wherever it might be
embedded.

They might still have the as2 tracking.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文