Ready to get started?

Learn more about the Adobe Analytics PowerShell Cmdlets or download a free trial:

Download Now

PowerShell でAdobe Analytics Data データをCSV に落としてみた

標準PowerShell cmdlets を使ってAdobe Analytics テーブルにアクセス。

CData Cmdlets Module for Adobe Analytics は、直感的なAdobe Analytics データ連携を提供する標準cmdlet です。 本記事では、AdobeAnalytics Cmdlets を使ったサンプルを提供します。

Creating a Connection to Your Adobe Analytics Data

Adobe Analytics uses the OAuth authentication standard. To authenticate using OAuth, you will need to create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties. See the "Getting Started" section of the help documentation for a guide.

Retrieving GlobalCompanyId

GlobalCompanyId is a required connection property. If you do not know your Global Company ID, you can find it in the request URL for the users/me endpoint on the Swagger UI. After logging into the Swagger UI Url, expand the users endpoint and then click the GET users/me button. Click the Try it out and Execute buttons. Note your Global Company ID shown in the Request URL immediately preceding the users/me endpoint.

Retrieving Report Suite Id

Report Suite ID (RSID) is also a required connection property. In the Adobe Analytics UI, navigate to Admin -> Report Suites and you will get a list of your report suites along with their identifiers next to the name.

After setting the GlobalCompanyId, RSID and OAuth connection properties, you are ready to connect to Adobe Analytics.

$conn = Connect-AdobeAnalytics  -GlobalCompanyId "$GlobalCompanyId" -RSID "$RSID" -OAuthClientId "$OAuthClientId" -OauthClientSecret "$OauthClientSecret" -CallbackURL "$CallbackURL"

Selecting Data

Follow the steps below to retrieve data from the AdsReport table and pipe the result into to a CSV file:

Select-AdobeAnalytics -Connection $conn -Table AdsReport | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myAdsReportData.csv -NoTypeInformation

You will notice that we piped the results from Select-AdobeAnalytics into a Select-Object cmdlet and excluded some properties before piping them into an Export-Csv cmdlet. We do this because the CData Cmdlets append Connection, Table, and Columns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file.

The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the CData Cmdlets directly into another one.