AMP url 是否保留查询参数?
Does an AMP url retain the query parameters?
我以前看过这个问题,但很难找到直接的答案。我从可靠的来源听到了故事的两面。文档有限,但我确实从 Google 找到了这篇文章。
https://developers.google.com/amp/cache/overview#query-parameter-example
TLDR:
Query parameter example
The AMP Cache URL format can also include parameters in the query string. The following is an HTTPS example with parameters: https://example-com.cdn.ampproject.org/c/s/example.com/g?value=Hello%20World
我可以在要使用 AMP 缓存的页面上使用 PHP 中的 $_GET['utm_source']
吗?
是的,AMP 缓存支持查询参数。这是一个例子:
https://ampbyexample-com.cdn.ampproject.org/c/s/ampbyexample.com/g?value=Hello%20Alice
https://ampbyexample-com.cdn.ampproject.org/c/s/ampbyexample.com/g?value=Hello%20Bob
两个链接指向同一页面,但根据查询参数呈现不同的内容。 AMP 缓存反映了这种行为。
我以前看过这个问题,但很难找到直接的答案。我从可靠的来源听到了故事的两面。文档有限,但我确实从 Google 找到了这篇文章。
https://developers.google.com/amp/cache/overview#query-parameter-example
TLDR:
Query parameter example The AMP Cache URL format can also include parameters in the query string. The following is an HTTPS example with parameters: https://example-com.cdn.ampproject.org/c/s/example.com/g?value=Hello%20World
我可以在要使用 AMP 缓存的页面上使用 PHP 中的 $_GET['utm_source']
吗?
是的,AMP 缓存支持查询参数。这是一个例子:
https://ampbyexample-com.cdn.ampproject.org/c/s/ampbyexample.com/g?value=Hello%20Alice https://ampbyexample-com.cdn.ampproject.org/c/s/ampbyexample.com/g?value=Hello%20Bob
两个链接指向同一页面,但根据查询参数呈现不同的内容。 AMP 缓存反映了这种行为。