让网站知道他们是从 iOS 应用程序内的 WebView 访问的
我正在尝试找出通知分析跟踪器页面视图来自我的应用程序的最佳方式,而不是“直接访问”(例如)。
我有一个应用程序,可以显示大量不同新闻故事的列表视图,我想这样做,当用户点击其中一个故事并将其显示在我的 UIWebView 中时,正在加载的网站会以某种方式得到通知推荐来自“example-iphone-app”,或者可能是我的 iPhone 应用程序的网站?
有没有什么方法可以操纵 http 请求,使 iPhone 应用程序表现得好像该链接是由我网站上的推荐链接打开的?
我最初只想添加一个带有 ?source=myappname
等参数的查询字符串,但意识到这不是一种可靠(甚至有用)的方式来通过 Google Analytics、SiteMeter、Urchin 向网站所有者发出警报等来自请求的来源。
I'm trying to figure out the best way I can inform analytics trackers that the page view is coming from my app, rather than a 'direct visit' (for example).
I have an app that displays a list view of tons of different news stories, and I want to make it so that, when a user taps on one of the stories, and it is displayed in my UIWebView, the website being loaded is somehow informed that the referral came from 'example-iphone-app', or maybe my iPhone app's website?
Is there any way to manipulate the http request to make the iPhone app act as if the link is being opened by a referral link on my website?
I was originally thinking of just adding a query string with a parameter like ?source=myappname
, but realized this is not a reliable (or even useful) way of alerting site owners with Google Analytics, SiteMeter, Urchin, etc. from where the request has come.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Google Analytics(分析),则可以设置
utm_source
和utm_medium
查询参数,它们将显示为引荐来源。utm_source
是您放置myappname
参数的位置,并且utm_medium
可能应该设置为referral
,除非您按每个收费单击然后它通常设置为cpc
。If you're using Google Analytics then you can set the
utm_source
andutm_medium
query parameters and they will be displayed as the referral source.utm_source
is where you would put yourmyappname
parameter andutm_medium
should probably be set toreferral
unless you are charging per click then it is usually set tocpc
.