Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Using Download Tool for Search Analytics API

hda_wesleyjwk
7 - Meteor

Hi all,

 

I've been working for a while now on trying to download data from the Google Webmaster Tools Search Analytics API but have had no success so far.

 

I get as far as successfully connect to the API through the following URL (https://www.googleapis.com/webmasters/v3/sites/SITEURL/searchAnalytics/query), but keep on retrieving a parse error:

 

{¶
·"error":·{¶
··"errors":·[¶
···{¶
····"domain":·"global",¶
····"reason":·"parseError",¶
····"message":·"Parse·Error"¶
···}¶
··],¶
··"code":·400,¶
··"message":·"Parse·Error"¶
·}¶
}¶

The query originally uses POST HTTP action and Content-Type application/json. I've included the latter in the Header tab of the Download tool along with my Authorization and Host (www.googleapis.com).

 

Is there anyone out there that happens to have some experience downloading data from the Search Analytics API or using a JSON query in the download tool? I've tried including the payload as constant values, written JSON string and a JSON field from the JSON build tool, but none have been successful.

 

{
 "startDate": "2016-07-01",
 "endDate": "2016-07-05",
 "dimensions": ["Date"]
}

 

I imagine covnerting the JSON string to encoded URL would work; I've tried this too but also no success.

 

Look forward to your replies.

 

Kind Regards,

 

Wesley

3 REPLIES 3
hda_wesleyjwk
7 - Meteor

It would seem I am a little premature. I just made it work using the JSON Create Macro as an input in the payload. :)

 

For others looking for the set-up:

 

URL: https://www.googleapis.com/webmasters/v3/sites/SITEURL/searchAnalytics/query

 

Configuration of Download tool:

Basic URL = Field URL

Output = String data encoded as Unicode UTF-8

Header Name Content-Type : application/json & Name Host : www.googleapis.com & Authorization Token

Payload = Take Query String/Body from Field JSON Create Output

 

Will post screenshots later.

fpinchon
8 - Asteroid

It is a very finicky process, and I spent quite some time making it work...

Here are the screenshots of the Download Tool Settings

Download Tool 1.PNG

 

Download Tool 2.PNG

 

Download Tool 3.PNG

 

 

 

For the URL, use a STRING formula with this content:

'https://www.googleapis.com/webmasters/v3/sites/[input your website]/searchAnalytics/query'

where [input your website] needs to be formatted this way in case of HTTPS:
https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Ftechcrunch.com%2F/searchAnalytics/query’

For the Payload, a V_WSTRING formula with this content:

/* Used to extract all queries for a single day */
'{
 "startDate": "'+[startDate]+'",
 "endDate": "'+[startDate]+'",
 "dimensions": ["date","query","page","country","device"]
}'

 

Overall, it is a quite challenging API, but very useful. I posted my R&D here:

http://insightsthroughdata.com/how-to-analyze-easily-google-search-console-data-in-tableau/

 

Cheers,

Frederic

matthieusparkles
7 - Meteor

I couldn't get this setup working untill i changed some settings; which you can read here:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Google-Search-Console-API/m-p/344872/h...

 

I'm very happy with this now! :-)

 


 

@fpinchon wrote:

It is a very finicky process, and I spent quite some time making it work...

Here are the screenshots of the Download Tool Settings

Download Tool 1.PNG

 

Download Tool 2.PNG

 

Download Tool 3.PNG

 

 

 

For the URL, use a STRING formula with this content:

'https://www.googleapis.com/webmasters/v3/sites/[input your website]/searchAnalytics/query'

where [input your website] needs to be formatted this way in case of HTTPS:
https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Ftechcrunch.com%2F/searchAnalytics/query’

For the Payload, a V_WSTRING formula with this content:

/* Used to extract all queries for a single day */
'{
 "startDate": "'+[startDate]+'",
 "endDate": "'+[startDate]+'",
 "dimensions": ["date","query","page","country","device"]
}'

 

Overall, it is a quite challenging API, but very useful. I posted my R&D here:

http://insightsthroughdata.com/how-to-analyze-easily-google-search-console-data-in-tableau/

 

Cheers,

Frederic

Labels