schulzefelix / laravel-search-console Goto Github PK
View Code? Open in Web Editor NEWA Laravel package to retrieve data from Google Search Console
License: MIT License
A Laravel package to retrieve data from Google Search Console
License: MIT License
Hello,
Does the service account option work with searchAnalyticsQuery I can seem to list all sites but its not showing as authenticated.
I have the service_account.json file.
Into: Config/search-console, At: Connections i get path of file json.
And have error:
Unable to read the credential file specified by GOOGLE_APPLICATION_CREDENTIALS: file laravel-search-console does not exist.
I have added account to google webmaster tool ?
Please help me, thank you !
Hi,
I want to fetch Search Console API data aggregated by Page. So I am looking for a way to set "aggregationType" to "byPage" in the request body.
API Doc : https://developers.google.com/webmaster-tools/search-console-api-original/v3/searchanalytics/query
Can someone guide me how to do this with Laravel?
Refer : https://developers.google.com/webmaster-tools/v1/searchanalytics/query.
Thanks for this amazing laravel package!
Just wanted to know this before starting a new project.
Refer :
https://developers.google.com/webmaster-tools/v1/urlInspection.index/urlInspection.index
If it is possible can someone point me in right direction?
$data = SearchConsole::setAccessToken($token)->setQuotaUser('uniqueQuotaUserString')
->searchAnalyticsQuery(
'https://www.example.com/',
Period::create(Carbon::now()->subDays(30), Carbon::now()->subDays(2)),
['query', 'page', 'country', 'device', 'date'],
[['dimension' => 'query', 'operator' => 'notContains', 'expression' => 'cheesecake']],
1000,
'web',
'all',
'auto'
);
ErrorException
PHP 8.1.22
9.52.16
Undefined variable $token
how can i get $token?
I want to change the datastate to all
as explained here https://searchengineland.com/google-search-console-api-gains-fresh-data-more-344552
In order to retrieve fresh data that is less than 1 day old.
The current default does not return this fresh data when I use this package.
I can see that there's a setDatastate
function on both Google_Service_Webmasters_SearchAnalyticsQueryRequest
and Google_Service_SearchConsole_SearchAnalyticsQueryRequest
but I can't figure out how to change it using this package.
This is my current code
$site = 'sc-domain:mydomain.com';
$searchConsole = app(SearchConsole::class);
putenv(sprintf('GOOGLE_APPLICATION_CREDENTIALS=%s', config('search-console.connections.service_account.application_credentials')));
$period = Period::create(Carbon::now()->subDays(30), Carbon::now());
$dimensions = [
'date',
];
$performanceData = $searchConsole->searchAnalyticsQuery($site, $period, $dimensions);
Any help appreciated
$sites = SearchConsole::setAccessToken($token)->listSites();
how to get $token
Hello @schulzefelix
I was wondering if you aware of any options/ways to sort the returned information. I'd like to ensure not asking large chunks of data only to sort them out on my end. I've not been able to find anything in the Googel docs. Any suggestions or ideas?
Viele Grüße,
Peter
Hi. First of all, thank you for this awesome package!
I am using with a GOOGLE_AUTH_TYPE=service_account, so I need to put my credentials as a .json.
The package must be modified so it works under all circumstances: commands, test, and calling from a route.
For instance, if we have:
GOOGLE_APPLICATION_CREDENTIALS=search-console-credentials.json
When calling via a controller web this would fail, because file_exists in guardAgainstInvalidConfiguration is checking relative to public path.
We can use helper function base_path() to grab the correct file.
I figured out the issue, my apologies
I get this error:
Class 'App\Http\Controllers\Period' not found
What's the libreary for Period?
Hey, do you plan to add support for Laravel 6?
Would be awesome!
Thank you :)
When i use:
$sites = SearchConsole::setAccessToken($token)->listSites();
return $sites;
i get the following error:
Non-static method SchulzeFelix\SearchConsole\SearchConsole::setAccessToken() cannot be called statically
Hi, @schulzefelix
Thank you for supplying this awesome package!
after getting a token from google, get this error:
Using $this when not in object context
public function setAccessToken($accessToken)
{
if (is_array($accessToken)) {
$accessToken = trim(json_encode($accessToken));
}
**$this->client->setAccessToken($accessToken);**
$this->client->getGoogleClient()->getCache()->clear();
return $this;
}
`
$token is a string. PHP7.4+Laravel 8+laravel-search-console 1.7.1
any suggestion?! thank you.
Hey, first at all: Thank you for your great package. It's very useful for my application.
But I'm having problems to list all sitemaps of a specific URL.
Is it possible with your search-console package to crawl this informations?
Thank you! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.