I'm giving promotions to users who sends us other visitors. This is done on the client side.

我正在向向我们发送其他访问者的用户进行促销活动。这是在客户端完成的。

I can do this using dynamic GET parameters, e.g. http://www.mysite.com?app_source=user_id or I can do this using the hash, e.g. http://www.mysite.com#app_source,user_id.

我可以使用动态GET参数来完成此操作,例如: http://www.mysite.com?app_source=user_id或我可以使用哈希,例如HTTP://www.mysite.com#app_source,user_id。

Are there any pros and cons for any of these methods?

这些方法有任何优缺点吗?

9 个解决方案

#1


5

Query String

  • Google Analytics, server logs, et al will have a record of the URL, which may be beneficial for later analysis.
  • Google Analytics,服务器日志等都会记录网址,这可能有助于以后的分析。

  • Multiple URLs make caching harder and have a slight chance of confusing the Google
  • 多个网址会使缓存更加困难,并且很可能会让Google感到困惑

Hash

  • Analytics and server logs will not see/pay attention to hash params
  • 分析和服务器日志不会看到/关注哈希参数

The more semantic way of handling this is probably through a query string parameter, but it's not very strong. If none of the above-listed points is relevant, I would probably just stick with query strings because it is more common.

处理这种情况的更多语义方式可能是通过查询字符串参数,但它不是很强。如果上面列出的点都不相关,我可能会坚持使用查询字符串,因为它更常见。

If you mean that you are building a service that other people integrate, and you don't want them to have to pass information back to their application (via query string), then using hash params seems like a solid option.

如果您的意思是构建其他人集成的服务,并且您不希望他们必须将信息传递回他们的应用程序(通过查询字符串),那么使用哈希参数似乎是一个可靠的选项。

更多相关文章

  1. “错误:路径必须是字符串”(v5.10.0)
  2. javascript 截取字符串方法汇总
  3. JavaScript String(字符串对象)
  4. JS将字符串转换为数组
  5. 在变量名是字符串时声明变量?
  6. 可编辑div中的文本计数和子字符串
  7. 使用append方法将对象转换为字符串
  8. $.each遍历JSON字符串和 Uncaught TypeError: Cannot use 'in' o
  9. 如何在python中使用命名组和datadict从正则表达式模式中组合字符

随机推荐

  1. Android的理解
  2. android安全问题(五) 抢先拦截短信 - 结果
  3. android生命周期的例子
  4. Android日历只显示年月,只显示年
  5. Android(安卓)从枚举到注解最佳实践
  6. Android用户界面设计
  7. android ndk 入门 - 一个简单的ndk工程
  8. The "Android" command is deprecated.
  9. Android 抽屉式
  10. 2013.09.09——— android 判断存储卡是