Google App Engine:流量来源 [英] Google App Engine: traffic source

查看:116
本文介绍了Google App Engine:流量来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以确定Google App Engine网站的流量来自哪里?例如以前的网站,用户是在?

谢谢。

解决方案

如何在Google App Engine中实施防链接功能

  def get(self):
referer = self.request.headers.get(Referer)
#如果标题中没有引用referer,则为None。

我刚刚在 console

  import os 
os .environ ['HTTP_REFERER']

然后返回

 'http://con.appspot.com/console/'

然而,在使用之前检查它是否在那里。

Is there a way to identify where traffic to a Google App Engine website is coming from? e.g. the previous website that the user was on?

Thanks.

解决方案

From How to implement hotlinking prevention in Google App Engine

def get(self):
    referer = self.request.headers.get("Referer")
    # Will be None if no referer given in header.

And I've just tried this in the console:

import os
os.environ['HTTP_REFERER']  

And it returned

'http://con.appspot.com/console/'

Check if it's there first before using however.

这篇关于Google App Engine:流量来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆