in Education by
I had to add some ugly links in my website that looks like: "/page/?utm_source=value&utm_source=value2&utm_source=value3...." and I would like to keep the URLs clean. I found this directives that I tried, it does redirect but the tracker doesn't work coz it's not passed to GA. RewriteCond %{QUERY_STRING} ^((.*?)&|)utm_ RewriteRule ^(.*)$ /$1?%2 [R=301,NE,L] Is there another solution for this? Thanks JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
It seems there is no clear way to do this. I checked couple of big websites using utm_campain and it stays after clicking the link, so even big websites consider this as fine. But if one really wants to remove it, it can be done manually. Assuming that you have canonical address (which you should have if you care about SEO), see some PHP-pseudocode: function cleanupUtm($currentCanonicalUrl) { $currentUrl = $_SERVER['REQUEST_URI']; // Check are there "utm_" parameters in current URL if (strpos($currentUrl, 'utm_') === false) { return; } redirect($currentCanonicalUrl); } function redirect($location) { // Some helper redirect function, see https://stackoverflow.com/a/768472/1657819 header("Location: " . $location); die(); } But obviously it will trigger extra redirect and page reload. Alternative As an alternative, you may consider using Google Tag Manager to replace long boring URL with campaign to some neat URL like https://example.com/#instagram. See for example this article While it looks neat (and much better than long utm... string), I feel that it gives you less flexibility (or you will end up with hundreds of tags for all the cases you need)

Related questions

0 votes
    Good Day All I am completely new to this type of query but is it possible to define a url on a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am trying to use change tracking to copy data incrementally from a SQL Server to an Azure SQL Database. I ... change tracking table? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I need to remove zeros that are in the middle of a string, while keeping the ones at the end (in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I need to remove zeros that are in the middle of a string, while keeping the ones at the end (in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    I need to remove zeros that are in the middle of a string, while keeping the ones at the end (in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    Software Stack: React I am trying to get my website analytics, for this, I am using react-ga ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    If θ is the angle, in degrees, between the longest diagonal of the cube and any one of the edges of the cube ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 17, 2021 in Education by JackTerrance
0 votes
    Gauri said that she can play the keyboard __________ her sister. as well as as better as as nicest as as worse ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 17, 2021 in Education by JackTerrance
0 votes
    I have some website which requires a logon and shows sensitive information. The person goes to the page, is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    Which pattern collects and reports all exceptions to a centralized exception tracking service? A. Distributed tracing B. Audit logging C. Application logging D. Exception tracing...
asked Jan 11, 2023 in Education by JackTerrance
0 votes
    _________ are the special type of programs used for recording and tracking user's keystroke. (a) Keylogger (b) ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 5, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a session tracking method? (a) URL rewriting (b) History (c) Cookies (d) SSL sessions ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    There is a file that was being tracked by git, but now the file is on the .gitignore list. However, ... completely forget about it? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Which of the following command updates tracking for files that are modified? (a) git add . (b) git ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 29, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a session tracking method? (a) URL rewriting (b) History (c) Cookies ( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
...