如何扩展Blogengine.Net以收集访客统计数据?

时间:2022-02-25 09:01:28

I love BlogEngine. But from what I can se it does not collect the standard information about the visitors I would like to see (referrer, browser-type and so on).

我喜欢BlogEngine。但是从我可以看到它并没有收集有关我想看到的访问者的标准信息(推荐人,浏览器类型等)。

When I log in as Admin I have a menu item named "Referrer". I can choose a weekday and then I'll be presented with 1 or 2 rows with

当我以Admin身份登录时,我有一个名为“Referrer”的菜单项。我可以选择工作日,然后我将获得1或2行

"google.com 4 hits, "itmaskinen.se 6 hits" and so on, But that's not what I want to se, I want to se where my visitors come from, country, IP if possible, how many visitors and so on.

“google.com 4次点击,”itmaskinen.se 6次点击“等等,但这不是我想要的,我想看看我的访客来自哪里,国家,IP如果可能,有多少访客等等。

If someone of you are familiar with Blogengine.Net and can point me in the right direction to where I would put my own log-code or if you know any visitor-statistic-extension that can do it for me, I would be really happy to know. I prefer an extension, because if I make changes myself to BlogEngine it may break later updates I install.

如果你们中的某个人熟悉Blogengine.Net并且可以指出我在哪里放置我自己的日志代码的正确方向,或者如果你知道任何可以为我做的访客统计扩展,我会很高兴知道。我更喜欢扩展,因为如果我自己更改BlogEngine,它可能会破坏我安装的更新版本。

Blogengine.Net is a blog software made in .Net found here: http://www.dotnetblogengine.net/

Blogengine.Net是一个用.Net制作的博客软件,可在这里找到:http://www.dotnetblogengine.net/

And yes, I prefer to take this question here rather then in the Blogengine.Net forum, you know why. ;)

是的,我更喜欢在这里提出这个问题而不是Blogengine.Net论坛,你知道为什么。 ;)

(Anyone, feel free to edit my (bad) english in this post and after that delete this sentence)

(任何人,在这篇文章中随意编辑我的(坏)英语,然后删除这句话)

6 个解决方案

#1


9  

This isn't an extension, but it's what I use to collect all my blogengine.net data and it should be upgrade safe.

这不是扩展,但它是我用来收集所有blogengine.net数据的,它应该是升级安全的。

When you log into the Blogengine.NET admin screens you can go to "Settings> Custome Code > Tracking Script", here you can put your http://www.google.com/analytics/ logging script. Google Analytics provides all the referrer, browser type, etc stuff you were wanting. And what's nice is you can then create additional accounts for other sites if you choose.

当您登录Blogengine.NET管理员屏幕时,您可以转到“设置>客户代码>跟踪脚本”,您可以在此处输入您的http://www.google.com/analytics/日志记录脚本。 Google Analytics提供您想要的所有引荐来源,浏览器类型等内容。如果您愿意,那么您可以为其他网站创建其他帐户。

#2


5  

I use both Google Analytics and StatCounter to track visitor stats. I find that each one provides useful information that the other doesn't. And they're both free to a certain extent.

我同时使用Google Analytics和StatCounter来跟踪访问者统计信息。我发现每一个都提供了另​​一个没有的有用信息。他们在一定程度上都是*的。

I place their javascript code int the site.master file of my custom BE.Net skin.

我将他们的javascript代码放在我的自定义BE.Net皮肤的site.master文件中。

For Google Analytics I go a step further and pass the username of authenticated users as a custom variable. That way I can match users names up with the stats. To do this you can use the _setVar javascript method on the GA pageTracker like so:

对于Google Analytics,我更进一步,将经过身份验证的用户的用户名作为自定义变量传递。这样我就可以将用户名称与统计数据相匹配。为此,您可以在GA pageTracker上使用_setVar javascript方法,如下所示:

<script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-129049-25");
    var userDefinedValue = '<%= System.Web.Security.Membership.GetUser() != null ? System.Web.Security.Membership.GetUser().UserName : "" %>';
    pageTracker._setVar(userDefinedValue);
    pageTracker._trackPageview();
</script>

#3


5  

Anyone noticed that we miss all the hits coming from RSS readers? Syndication.axd does not run the analytics javascripts. So we miss the vast majority of viewers from the statistics. And we happily analyze that is just not impotant - ad-hoc visitors.

有人注意到我们错过了来自RSS阅读器的所有热门歌曲吗? Syndication.axd不运行分析javascripts。所以我们从统计数据中错过绝大多数观众。我们很高兴地分析这不是重要的 - 临时访客。

#4


0  

For the vast majority of cases, Google Analytics does just fine. It all depends on how much data you want. For example, if you want to keep note of IP addresses and resolve them to get domain names, and also highlight all visits to your blog from, say, your coworkers at the company where you work, you'd have to write some custom code yourself. However, it's all fairly primitive - these sorts of things are easily achievable using ASP.NET.

对于绝大多数情况,Google Analytics都可以。这一切都取决于你想要多少数据。例如,如果您想记下IP地址并解析它们以获取域名,并且还要突出显示您所在公司的所有访问,例如,您工作的公司的同事,则必须编写一些自定义代码你自己。但是,这一切都相当原始 - 使用ASP.NET可以轻松实现这些类型的事情。

#5


0  

I set up gathering statistics on IIS web site of my BlogEngine instance and then analyze the logs using WebLog Expert - http://www.weblogexpert.com.

我在我的BlogEngine实例的IIS网站上设置了收集统计信息,然后使用WebLog Expert分析日志 - http://www.weblogexpert.com。

It is more reliable than google analytics, since I see really ALL requests that are coming to my IIS, no matter if this is a request to axd or to some static content. And, once I've found out that google was fooling me in the number of visits. After that I trust my IIS statistics much more than google.

它比谷歌分析更可靠,因为我看到真正发送到我的IIS的所有请求,无论这是对axd或某些静态内容的请求。而且,一旦我发现谷歌在访问次数上欺骗了我。之后,我相信我的IIS统计数据远远超过谷歌。

#6


0  

There is a Widget which can be use to display Visits and Online Users Statistics.
You can find it from following links:
http://www.nuget.org/packages/Statistics/
http://www.itnerd.ir/post/2013/07/25/Visits-and-Online-Users-Statistics-widget-for-BlogEngine-2
but to see the instructions go to the second link.

有一个Widget可用于显示访问和在线用户统计信息。您可以通过以下链接找到它:http://www.nuget.org/packages/Statistics/ http://www.itnerd.ir/post/2013/07/25/Visits-and-Online-Users-Statistics- widget-for-BlogEngine-2但要查看说明,请转到第二个链接。

#1


9  

This isn't an extension, but it's what I use to collect all my blogengine.net data and it should be upgrade safe.

这不是扩展,但它是我用来收集所有blogengine.net数据的,它应该是升级安全的。

When you log into the Blogengine.NET admin screens you can go to "Settings> Custome Code > Tracking Script", here you can put your http://www.google.com/analytics/ logging script. Google Analytics provides all the referrer, browser type, etc stuff you were wanting. And what's nice is you can then create additional accounts for other sites if you choose.

当您登录Blogengine.NET管理员屏幕时,您可以转到“设置>客户代码>跟踪脚本”,您可以在此处输入您的http://www.google.com/analytics/日志记录脚本。 Google Analytics提供您想要的所有引荐来源,浏览器类型等内容。如果您愿意,那么您可以为其他网站创建其他帐户。

#2


5  

I use both Google Analytics and StatCounter to track visitor stats. I find that each one provides useful information that the other doesn't. And they're both free to a certain extent.

我同时使用Google Analytics和StatCounter来跟踪访问者统计信息。我发现每一个都提供了另​​一个没有的有用信息。他们在一定程度上都是*的。

I place their javascript code int the site.master file of my custom BE.Net skin.

我将他们的javascript代码放在我的自定义BE.Net皮肤的site.master文件中。

For Google Analytics I go a step further and pass the username of authenticated users as a custom variable. That way I can match users names up with the stats. To do this you can use the _setVar javascript method on the GA pageTracker like so:

对于Google Analytics,我更进一步,将经过身份验证的用户的用户名作为自定义变量传递。这样我就可以将用户名称与统计数据相匹配。为此,您可以在GA pageTracker上使用_setVar javascript方法,如下所示:

<script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-129049-25");
    var userDefinedValue = '<%= System.Web.Security.Membership.GetUser() != null ? System.Web.Security.Membership.GetUser().UserName : "" %>';
    pageTracker._setVar(userDefinedValue);
    pageTracker._trackPageview();
</script>

#3


5  

Anyone noticed that we miss all the hits coming from RSS readers? Syndication.axd does not run the analytics javascripts. So we miss the vast majority of viewers from the statistics. And we happily analyze that is just not impotant - ad-hoc visitors.

有人注意到我们错过了来自RSS阅读器的所有热门歌曲吗? Syndication.axd不运行分析javascripts。所以我们从统计数据中错过绝大多数观众。我们很高兴地分析这不是重要的 - 临时访客。

#4


0  

For the vast majority of cases, Google Analytics does just fine. It all depends on how much data you want. For example, if you want to keep note of IP addresses and resolve them to get domain names, and also highlight all visits to your blog from, say, your coworkers at the company where you work, you'd have to write some custom code yourself. However, it's all fairly primitive - these sorts of things are easily achievable using ASP.NET.

对于绝大多数情况,Google Analytics都可以。这一切都取决于你想要多少数据。例如,如果您想记下IP地址并解析它们以获取域名,并且还要突出显示您所在公司的所有访问,例如,您工作的公司的同事,则必须编写一些自定义代码你自己。但是,这一切都相当原始 - 使用ASP.NET可以轻松实现这些类型的事情。

#5


0  

I set up gathering statistics on IIS web site of my BlogEngine instance and then analyze the logs using WebLog Expert - http://www.weblogexpert.com.

我在我的BlogEngine实例的IIS网站上设置了收集统计信息,然后使用WebLog Expert分析日志 - http://www.weblogexpert.com。

It is more reliable than google analytics, since I see really ALL requests that are coming to my IIS, no matter if this is a request to axd or to some static content. And, once I've found out that google was fooling me in the number of visits. After that I trust my IIS statistics much more than google.

它比谷歌分析更可靠,因为我看到真正发送到我的IIS的所有请求,无论这是对axd或某些静态内容的请求。而且,一旦我发现谷歌在访问次数上欺骗了我。之后,我相信我的IIS统计数据远远超过谷歌。

#6


0  

There is a Widget which can be use to display Visits and Online Users Statistics.
You can find it from following links:
http://www.nuget.org/packages/Statistics/
http://www.itnerd.ir/post/2013/07/25/Visits-and-Online-Users-Statistics-widget-for-BlogEngine-2
but to see the instructions go to the second link.

有一个Widget可用于显示访问和在线用户统计信息。您可以通过以下链接找到它:http://www.nuget.org/packages/Statistics/ http://www.itnerd.ir/post/2013/07/25/Visits-and-Online-Users-Statistics- widget-for-BlogEngine-2但要查看说明,请转到第二个链接。