Created
August 24, 2022 19:42
-
-
Save luratic-devs/407364967a5987837fcb763b58f4f86d to your computer and use it in GitHub Desktop.
Desglosa los informes de GA4 por cualquier dimensión
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (()=>{ | |
var url = window.location.href; | |
var message = 'Introduce una dimensión'; | |
var result = window.prompt(message); | |
result = JSON.stringify(result); | |
if (url.indexOf('_r.explorerCard..seldim%3D%5B.*%26') < -1) { | |
var regex = new RegExp('_r.explorerCard..seldim%3D%5B.*%26'); | |
url = url.replace(regex, '_r.explorerCard..seldim%3D%5B"eventName",' + result + '%5D%26'); | |
window.location.href = url; | |
} | |
url = url.replace("params=", 'params=_r.explorerCard..seldim%3D%5B"eventName",' + result + '%5D%26'); | |
window.location.href = url; | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment