Created
May 10, 2019 17:35
-
-
Save prykon/1f0d5101d4763b466b9c4fc6c11d477f to your computer and use it in GitHub Desktop.
Extraer GSC Keyword Data de Google Analytics
This file contains hidden or 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
for(var kwds=document.getElementsByClassName("_GApu"),clicks=document.getElementsByClassName("_GAtjb"),total=kwds.length,content='<table align="center"><tr><th>Keywords</th><th>Clicks</th><th>Impresiones</th><th>CTR</th><th>Ranking</th></tr>',i=0;i<total;i++){var current_kwd=kwds[i].innerHTML,current_clicks=clicks[i].innerText.split("(")[0].replace("%","").replace(".","").trim(),current_impresiones=clicks[i+1].innerText.split("(")[0].replace("%","").replace(".","").trim(),current_ctr=clicks[i+2].innerText.split("(")[0].replace("%","").replace(".","").trim(),current_posicion_media=clicks[i+3].innerText.split("(")[0].replace("%","").replace(".","").trim();i+=3;var row="<td>"+current_kwd+'</td><td align="center">'+current_clicks+'</td><td align="center">'+current_impresiones+'</td><td align="center">'+current_ctr+'</td><td align="center">'+current_posicion_media+"</td>";content+="<tr style=\"font-family: 'Open Sans'\">"+row+"</tr>"}with(output='<html><head><title>Punto Rojo Tools - Google Analytics Keyword Extractor</title><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans" /><link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" /></head><body>',output='<table align="center" width="50%"><tr><td align="left"><img src="https://puntorojo.agency/wp-content/themes/punto_rojo/img/logo_mini.png" width="200px"></td><td align="right"><h1 style="font-family: \'Open Sans\'">Google Analytics Keyword Extractor</h1></td></tr></table><br><br>',output+=content,output+="</body></html>",window.open())document.write(output),document.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment