各製品の資料を入手。
詳細はこちら →Viewing Google Analytics データ in RAD Studio Data Explorer
How to view Google Analytics データ in RAD Studio Data Explorer using the CData ODBC Driver for Google Analytics.
最終更新日:2023-06-12Embarcadero RAD Studio provides a development environment for Delphi and C++Builder applications. With the CData ODBC Driver for Google Analytics, you gain access to live Google Analytics データ within RAD Studio, abstracting the data into tables, views, and stored procedures that can be used to both retrieve Google Analytics データ. This article will walk through connecting to Google Analytics using the Data Explorer.
Configure a Connection to Google Analytics
If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.
OAuth 認証標準を使用してGoogle Analytics に接続します。ユーザーアカウントまたはサービスアカウントで認証できます。組織全体のアクセススコープをCData 製品に許可するには、サービスアカウントが必要です。下記で説明するとおり、CData 製品はこれらの認証フローをサポートします。
ユーザー資格情報の接続プロパティを設定せずに接続できます。次を設定して、接続してください。 Profile:接続するGoogle アナリティクスのプロファイル、またはビューに設定。この値はProfiles テーブルから取得できます。指定しない場合は、初めに返されたプロファイルが使われます。接続すると、CData 製品はデフォルトブラウザでOAuth エンドポイントを開きます。ログインして、アプリケーションにアクセス許可を与えます。CData 製品がOAuth プロセスを完了します。他のOAuth 認証フローについては、ヘルプドキュメントの「OAuth 認証の使用」を参照してください。
Connecting to Google Analytics データ Using Data Explorer
You can create a simple application for displaying Google Analytics データ by utilizing the CData FireDAC Components for Google Analytics and a new VCL Forms Application:
- Open the Data Explorer in RAD Studio and expand FireDAC.
- Right-click the ODBC Data Source node in the Data Explorer.
- Click Add New Connection.
- Enter a name for the connection.
- In the FireDAC Connection Editor that appears, set the DataSource property to the name of the ODBC DSN for Google Analytics.
- Back in the Data Explorer, expand the views for the connection.
Create a new VCL Forms application and drag a view (for example: Traffic) onto the form.
- Select the TrafficView object on the form and set the Active property to true.
Right-click on the object, bind visually, and link everything (*) to a new control (TStringGrid).
Arrange the TStringGrid on the form and run the application to see the Traffic data.
Related Articles
Below you can find other articles for using the CData ODBC Driver with RAD Studio, Delphi, and C++ Builder.