问题描述
我已经使用composer安装Google API并获得身份验证。没有任何问题,但是当我开始从网站和下载的文件看例子时,他们真的不一样。
在,它们以开始:
namespace Google\AdsApi\Examples\AdWords\v201609\Optimization;
需要'vendor / autoload.php';
使用Google\AdsApi\AdWords\AdWordsServices;
使用Google\AdsApi\AdWords\AdWordsSession;
使用Google\AdsApi\AdWords\AdWordsSessionBuilder;
使用Google\AdsApi\AdWords\v201609\cm\Keyword;
使用Google \AdsApi\AdWords\v201609\cm\KeywordMatchType;
使用Google\AdsApi\AdWords\v201609\cm\Language;
使用Google\AdsApi\AdWords\v201609\cm\Location;
...
最新版本(201609)没有init.php所以我认为在网站上的例子已经过时了。与下载的文件一起工作的例子很好,但是当我尝试学习不同的东西时,没有来自开发者网站的在线示例。
我想我错过了一些东西,但不知道那是什么。任何人都可以解释为什么这两个例子不同吗?感谢。
文档刚刚更新。请查看(如果它仅与PHP客户端库有关)或我们的,因为我们正在定期监控这两个网站,您可以更快得到答案。 :)
最好,
Thanet
I've installed Google API with composer and get authenticated. There are no problems about that but when i started to look at to examples from the web site and downloaded files they are really different.
In developer web site example codes starts with like:
// Include the initialization file
require_once dirname(dirname(__FILE__)) . '/init.php';
require_once UTIL_PATH . '/MapUtils.php';
But in downloaded files they start with like:
namespace Google\AdsApi\Examples\AdWords\v201609\Optimization;
require 'vendor/autoload.php';
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSession;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201609\cm\Keyword;
use Google\AdsApi\AdWords\v201609\cm\KeywordMatchType;
use Google\AdsApi\AdWords\v201609\cm\Language;
use Google\AdsApi\AdWords\v201609\cm\Location;
...
There are no "init.php" in latest version (201609) anymore so i think on web site the examples are outdated. Examples that come with downloaded files working good but when i try to learn something different there are no online examples from developers site.
I think I am missing something but don't know what is that is. Can anyone explain me why those two examples are different? Thanks.
The documentation has just been updated. Please have a look at that page again.Sorry for this confusion.
In the future, I highly recommend to post you questions either in our github repo's issues (if it's related to PHP client library only) or our AdWords API forum instead, as we're monitoring these two sites regularly and you could get answers much faster. :)
Best,Thanet
这篇关于Google Ads API PHP示例的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!