Open welshja opened 4 years ago
This is a "feature" of the Acquia hosting platform.
as a means to maximize performance via the Varnish caching layer, removes web analytics parameters from URLs (for example, Google Analytics' utm_source and others).
See also https://docs.acquia.com/cloud-platform/performance/varnish/querystrings/
The suggested solution is to use the drupal/acquia_analytics_redirects module.
This issue does NOT occur on a local www.devbox
build.
Team to determine if this can be done in Akamai.
sub vcl_recv { if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_term|utm_content)=") { return (pass); } }
This needs to be done in Akamai, not in code. Letting the utm_whatever
parameter go through to code will cause each separate value to result in a new page generation, which is not what we want.
In general, this will need to be done with a conditional rule that looks for utm_whatever
parameters (either utm_*
or an enumerated list of parameters we care about.)
Create a variable containing the values of all the specific parameter names we care about. e.g. utm_source=test&utm_medium=&utm_campaign=123&utm_content=456&utm_term=
. Then, if the response is a redirect, rewrite the Location
header, with logic to handle the cases where it does or does not contain query parameters.
Cons:
utm_
parameters that were not part of the original request.If the response status code is a redirect, then
Use the Modify Outgoing Response Header
behavior to change the Location
header.
{{ AK_QUERY }}
variable.news-events/cancer-currents-blog/biology
or noticias/temas-y-relatos-blog/desigualdades
)Investigate the creation of an EdgeWorker to extract the utm_*
parameters from the request and append them to the Location
header.
Cons:
This would be annoying, but if there's a redirection which needs analytics, it may be possible to use Edge Redirector which doesn't have this issue. (Note: Edge Redirector has a limit of 5,000 rules per policy, which limits the ability to simply move all existing redirects en masse.)
This is a refinement of "Property Manager Idea 2" (above).
Specifically, the redirection module will no longer be allowed to redirect to targets which have query parameters. Redirection targets with query parameters can be implemented in Edge Redirector, which has the ability to include query parameters.
This would presently affect 28 redirection rules for the cancer currents and temas-y-relatos blogs (e.g. news-events/cancer-currents-blog/biology
redirects to /news-events/cancer-currents-blog?topic=biology
)
This leads to an "Analytics Query Params" Akamai rule along the lines of
Location
response header.Location
with the entire extracted value, a ?
character, and the built-in {{AK_QUERY}}
variable.
Issue description
The expectation for redirects is that any query parameters are carried over with the redirect. This largely seems to be the case, but I'm noticing that UTM parameters are stripped off with a redirect.
If you look at the three URLs below, the redirect will carry the query param across the redirect except for the last one. https://www.cancer.gov/contact/emergency-preparedness/coronavirus?cid=test https://www.cancer.gov/contact/emergency-preparedness/coronavirus?chicken=test https://www.cancer.gov/contact/emergency-preparedness/coronavirus?utm_source=test
Please investigate and update so that UTM codes are passed through with the redirect. The UTM parameters are utm_source, utm_medium, utm_campaign, utm_content and utm_term.
Steps to reproduce the issue
What's the expected result?
Redirected URL should maintain the query parameters through the redirect process.
What's the actual result?
User is redirected to https://www.cancer.gov/about-cancer/coronavirus/coronavirus-cancer-patient-information with no query parameter attached.