quesofat/laravel-adwords-targeting-idea-service

Laravel 对 AdWords Targeting Idea Service 的包装;来自 Felix Schulze,此版本移除了 5.5 的要求

1.3.2 2018-03-04 13:21 UTC

This package is not auto-updated.

Last update: 2024-09-20 05:16:10 UTC


README

Latest Version Software License Build Status Quality Score StyleCI Latest Version on Packagist Total Downloads

安装

此包可以通过 Composer 安装。

$ composer require schulzefelix/laravel-adwords-targeting-idea-service

在 Laravel 5.5 中,此包将自动注册服务提供者。如果禁用了包发现,请添加以下内容。

// config/app.php
'providers' => [
    ...
    SchulzeFelix\AdWords\AdWordsServiceProvider::class,
    ...
];

在 Laravel 5.5 中,此包将自动注册外观。如果禁用了包发现,请添加以下内容。

// config/app.php
'aliases' => [
    ...
    'AdWords' => SchulzeFelix\AdWords\AdWordsFacade::class,
    ...
];

您可以使用以下命令发布此包的配置文件

php artisan vendor:publish --provider="SchulzeFelix\AdWords\AdWordsServiceProvider"

生成刷新令牌

此功能需要 clientIdclientSecret 来自一个 原生应用

Google Console: https://console.developers.google.com/apis/credentials

$ php artisan adwords:token

打开授权 URL。授权应用,并在控制台中输入访问令牌。将刷新令牌复制到配置文件 config/adwords-targeting-idea-service.php

用法

所有方法都将返回一个 Illuminate\Support\Collection 实例。

以下有两个基本示例,用于检索几个关键词的搜索量以及给定单词的新关键词想法。

搜索量

$searchVolumes = AdWords::searchVolumes(['cheesecake', 'coffee']);

关键词想法

$keywordIdeas = AdWords::keywordIdeas('coffee');

提供流畅配置

设置位置

有关 Criteria ID,请参阅 https://developers.google.com/adwords/api/docs/appendix/geotargeting

AdWords::location(2276)->searchVolumes(['cheesecake', 'coffee']);

设置语言

有关 Criteria ID,请参阅 https://developers.google.com/adwords/api/docs/appendix/codes-formats#languages

AdWords::location(2276)->language(1001)->searchVolumes(['cheesecake', 'coffee']);

包括目标每月搜索量

AdWords::withTargetedMonthlySearches()->searchVolumes(['cheesecake', 'coffee']);

将 NULL 值转换为零

AdWords::convertNullToZero()->location(2276)->language(1001)->searchVolumes(['cheesecake', 'coffee']);

包括和排除关键词想法中的单词

AdWords::location(2642)->exclude(['iphone'])->include(['apple'])->keywordIdeas('iphone');

变更日志

请参阅 CHANGELOG 了解最近更改的信息。

测试

$ vendor/bin/phpunit

贡献

请参阅 CONTRIBUTINGCONDUCT 了解详细信息。

安全

如果您发现任何与安全相关的问题,请通过电子邮件发送到 githubissues@schulze.co 而不是使用问题跟踪器。

致谢

许可

MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。