Examples of AdSense


Examples of com.google.api.services.adsense.AdSense

        .setTransport(TRANSPORT)
        .setClientSecrets(Constants.GOOGLE_PROJECT_CLIENT_ID, Constants.GOOGLE_PROJECT_CLIENT_SECRET).build()
        .setAccessToken(userModel.getAccessToken())
        .setRefreshToken(userModel.getRefreshToken());

        AdSense adSense = new AdSense(TRANSPORT, JSON_FACTORY, credential);

        // アカウントIDを取得
        System.out.println("Account ID:" + asString("id"));
        // 対象クライアントID
        String adClientId = "ca-" + accountId;

        // AdSense Unit の取得(有効な広告のみ)
        AdUnits adUnits = adSense.adunits().list(adClientId).setIncludeInactive(false).execute();
        if(adUnits.getItems() == null || adUnits.getItems().size() <= 0) {
            return forward("select_ad_unit.jsp");
        }

        List<AdUnit> targetUnits = new ArrayList<AdUnit>();
View Full Code Here

Examples of com.google.api.services.adsense.AdSense

        .setClientSecrets(Constants.GOOGLE_PROJECT_CLIENT_ID, Constants.GOOGLE_PROJECT_CLIENT_SECRET).build()
        .setAccessToken(userModel.getAccessToken())
        .setRefreshToken(userModel.getRefreshToken());

        try {
            AdSense adSense = new AdSense(TRANSPORT, JSON_FACTORY, credential);

            // アカウント(複数)を取得
            Accounts accounts = adSense.accounts().list().execute();
            requestScope("accounts", accounts);

        }catch(Exception e) {
            // アカウント存在しない場合はエラーになるが、エラーの表示をJSPで行うので何もしない。
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.