整个网站永久网址查询字符串? [英] Persistent URL query string throughout the entire site?

查看:211
本文介绍了整个网站永久网址查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是那些情况下,我觉得有就在我面前一个简单的答案之一... ...希望你们/加尔斯能告诉我光。

This is one of those situations where I feel like there is a simple answer right in front of me...hopefully you guys/gals can show me the light.

问题:

我有一个希望保持跨在其网站上的所有网页的查询字符串,只要他们通过一个包含查询字符串中的链接到达现场的客户。

I have a client that wants to maintain a query string across all pages on their site, only if they arrived at the site via a link that contains the query string.

此查询字符串还需要与站点中的任何外部链接通过。

This query string would also need to be passed with any external link from the site.

信息:

查询字符串的一个例子:

An example of the query string :

utm_medium =< ad_placement>&安培; utm_source =< ad_source>

(显然,这是从广告跟踪转化)

(Obviously this is for tracking conversions from ads)

我们正在通过谷歌分析(所以,是的,我知道这是一个二选一)目前跟踪所有这些东西,这是报告的一个额外层。

We're currently tracking all this stuff via Google Analytics (so, yes, I know that's an alternative), this is for an extra layer of reporting.

我没有code自己的网站,这带来了它自己的一系列问题(例如:我什至不知道他们使用的所有页面之间的公共头) - 所以我希望有一个KISS的答案了有这一点。

I did not code their site, which brings it's own set of issues (example: I'm not even sure they use a common header among all pages) - so I'm hoping there is a KISS answer out there for this.

有什么建议?

推荐答案

所以 - 在这里的回答是这样的:

So - the answer here was this :

  1. 使用JS抢查询字符串
  2. 验证查询字符串
  3. 添加到一个cookie
  4. 追加cookie'd查询字符串中的DOM
  5. 每一个HREF
  1. Use JS to grab the query string
  2. Validate the query string
  3. Add to a cookie
  4. Append the cookie'd query string to every href in the DOM

就像我说的......我知道有一个简单的例子盯着我的脸,哈哈!

Like I said...I knew there was a simple example staring me in the face haha!

这篇关于整个网站永久网址查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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