-
Notifications
You must be signed in to change notification settings - Fork 2
Add Google Search Console plugin #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "name": "countryBreakdown", | ||
| "displayName": "Country breakdown", | ||
| "description": "Returns search performance metrics grouped by country", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "postBody": { | ||
| "startDate": "{{new Date(timeframe.start).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date(timeframe.end).toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "country" | ||
| ], | ||
| "rowLimit": 25000, | ||
| "dataState": "final" | ||
| }, | ||
| "postRequestScript": "postRequest/countryBreakdown.js", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| "providesPluginDiagnostics": true, | ||
| "timeframes": true, | ||
| "tags": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "name": "deviceBreakdown", | ||
| "displayName": "Device breakdown", | ||
| "description": "Returns search performance metrics grouped by device type", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "postBody": { | ||
| "startDate": "{{new Date(timeframe.start).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date(timeframe.end).toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "device" | ||
| ], | ||
| "rowLimit": 25000, | ||
| "dataState": "final" | ||
| }, | ||
| "postRequestScript": "postRequest/deviceBreakdown.js", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| "providesPluginDiagnostics": true, | ||
| "timeframes": true, | ||
| "tags": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "name": "pageDistribution", | ||
| "displayName": "Page distribution", | ||
| "description": "Returns a distribution of queries by search ranking position for the selected page", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "getArgs": [], | ||
| "headers": [], | ||
| "postBody": { | ||
| "startDate": "{{new Date(timeframe.start).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date(timeframe.end).toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "query" | ||
| ], | ||
| "dimensionFilterGroups": [ | ||
| { | ||
| "filters": [ | ||
| { | ||
| "dimension": "page", | ||
| "operator": "equals", | ||
| "expression": "{{scope?.[0]?.name}}" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "rowLimit": 25000 | ||
| }, | ||
| "postRequestScript": "postRequest/pageDistribution.js" | ||
| }, | ||
| "providesPluginDiagnostics": true, | ||
| "timeframes": true, | ||
| "tags": [], | ||
|
|
||
| "ui": [ | ||
| { | ||
| "name": "scope", | ||
| "objectLimit": 1, | ||
| "label": "Scope", | ||
| "type": "objects", | ||
| "matches": { | ||
| "sourceType": { | ||
| "type": "equals", | ||
| "value": "gsc-page" | ||
| } | ||
| }, | ||
| "validation": { | ||
| "required": true | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "name": "pagePerformanceOverTime", | ||
| "displayName": "Page performance over time", | ||
| "description": "Returns daily clicks, impressions and CTR trends for the selected page", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "postBody": { | ||
| "startDate": "{{new Date(timeframe.start).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date(timeframe.end).toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "date" | ||
| ], | ||
| "dimensionFilterGroups": [ | ||
| { | ||
| "filters": [ | ||
| { | ||
| "dimension": "page", | ||
| "operator": "equals", | ||
| "expression": "{{scope?.[0]?.name}}" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "rowLimit": 25000 | ||
| }, | ||
| "postRequestScript": "postRequest/pagePerformanceOverTime.js", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| "providesPluginDiagnostics": true, | ||
| "timeframes": true, | ||
| "tags": [], | ||
|
|
||
| "ui": [ | ||
| { | ||
| "name": "scope", | ||
| "objectLimit": 1, | ||
| "label": "Scope", | ||
| "type": "objects", | ||
| "matches": { | ||
| "sourceType": { | ||
| "type": "equals", | ||
| "value": "gsc-page" | ||
| } | ||
| }, | ||
| "validation": { | ||
| "required": true | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "name": "pagePerformanceSummary", | ||
| "displayName": "Page performance summary", | ||
| "description": "Returns performance metrics for a given page", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "getArgs": [], | ||
| "headers": [], | ||
| "postBody": { | ||
| "startDate": "{{new Date(timeframe.start).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date(timeframe.end).toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "page" | ||
| ], | ||
| "dimensionFilterGroups": [ | ||
| { | ||
| "filters": [ | ||
| { | ||
| "dimension": "page", | ||
| "operator": "equals", | ||
| "expression": "{{scope?.[0]?.name}}" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "rowLimit": 25000 | ||
| }, | ||
| "postRequestScript": "postRequest/script1.js" | ||
| }, | ||
| "providesPluginDiagnostics": true, | ||
| "timeframes": true, | ||
| "tags": [], | ||
|
|
||
| "ui": [ | ||
| { | ||
| "name": "scope", | ||
| "objectLimit": 1, | ||
| "label": "Scope", | ||
| "type": "objects", | ||
| "matches": { | ||
| "sourceType": { | ||
| "type": "equals", | ||
| "value": "gsc-page" | ||
| } | ||
| }, | ||
| "validation": { | ||
| "required": true | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "name": "pageUrLs", | ||
| "displayName": "Page URLs", | ||
| "description": "Returns a list off URLs with impressions in the last year", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "postBody": { | ||
| "startDate": "{{new Date(Date.now() - 365 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date().toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "page" | ||
| ], | ||
| "rowLimit": 25 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do this or other streams need paging configured?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't need explicit paging but I definitively need to check the |
||
| }, | ||
| "postRequestScript": "postRequest/pageUrLs.js", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| "timeframes": false, | ||
| "providesPluginDiagnostics": true, | ||
| "tags": [] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "name": "pages", | ||
| "displayName": "Pages", | ||
| "description": "Returns a complete list of pages with performance metrics", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "postBody": { | ||
| "startDate": "{{new Date(timeframe.start).toISOString().split('T')[0]}}", | ||
| "endDate": "{{new Date(timeframe.end).toISOString().split('T')[0]}}", | ||
| "dimensions": [ | ||
| "page" | ||
| ], | ||
| "rowLimit": 25000 | ||
| }, | ||
| "postRequestScript": "postRequest/pages.js", | ||
| "getArgs": [], | ||
| "headers": [] | ||
| }, | ||
| "providesPluginDiagnostics": true, | ||
| "timeframes": true, | ||
| "tags": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "name": "previousPeriodPagePerformance", | ||
| "displayName": "Previous period page performance", | ||
| "description": "Returns a summary of performance for the previous period of a given timeframe for the selected page", | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "errorHandling": { | ||
| "type": "default" | ||
| }, | ||
| "paging": { | ||
| "mode": "none" | ||
| }, | ||
| "expandInnerObjects": true, | ||
| "getArgs": [], | ||
| "headers": [], | ||
| "postBody": { | ||
| "startDate": "{{new Date(new Date(timeframe.start).getTime() - (new Date(timeframe.end).getTime() - new Date(timeframe.start).getTime()) - 86400000).toISOString().split('T')[0]}}", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't quite get my head around what happens if selected yearly ranges or something here - do we need to restrict the available timeframes?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t think we need to restrict timeframes, as the calculation should work within 1 day error - I guess the main consideration is performance but I've not been able to test with a large dataset (and GSC data has a max query timeframe of 16 months) |
||
| "endDate": "{{new Date(new Date(timeframe.start).getTime() - 86400000).toISOString().split('T')[0]}}", | ||
| "dimensions": ["page"], | ||
| "dimensionFilterGroups": [ | ||
| { | ||
| "filters": [ | ||
| { | ||
| "dimension": "page", | ||
| "operator": "equals", | ||
| "expression": "{{scope?.[0]?.name}}" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "rowLimit": 25000 | ||
| }, | ||
| "postRequestScript": "postRequest/script1.js" | ||
| }, | ||
| "timeframes": true, | ||
| "providesPluginDiagnostics": true, | ||
| "tags": [], | ||
| "visibility": { | ||
| "type": "hidden" | ||
| }, | ||
| "ui": [ | ||
| { | ||
| "name": "scope", | ||
| "objectLimit": 1, | ||
| "label": "Scope", | ||
| "type": "objects", | ||
| "matches": { | ||
| "sourceType": { | ||
| "type": "equals", | ||
| "value": "gsc-page" | ||
| } | ||
| }, | ||
| "validation": { | ||
| "required": true | ||
| } | ||
| } | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look quite right - the timeframe is 'now -> whatever end date selected in SquaredUp'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stream is used for object discovery / indexing where I wanted to pull pages seen in the last year regardless of the dashboard timeframe (the API always requires a
startDateandendDate)You reckon I need to update it somehow or is it okay for that?