Google API Connector UserGuide

19
© 2013 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. All other company and product names may be trade names or trademarks of their respective owners and/or copyrighted materials of such owners. Google API User Guide

description

c

Transcript of Google API Connector UserGuide

Page 1: Google API Connector UserGuide

© 2013 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. All other company and product names may be trade names or trademarks of their respective owners and/or copyrighted materials of such owners.

Google API User Guide

Page 2: Google API Connector UserGuide

2

Abstract

Google API user guide provides a brief introduction on cloud connectors and its features.

The guide provides detailed information on setting up the connector and running data synchronization tasks (DSS). A brief overview of supported features and task operations that can be performed using Google API connector is mentioned.

Table of Contents

Overview .......................................................................................................................................... 3

Google API Connector ..................................................................................................................... 3

Enabling Google API Connector ...................................................................................................... 3

API’s supported by the connector.................................................................................................... 4

Creating a Google API Connection ................................................................................................. 6

Creating Google API Data Synchronization Task ........................................................................... 8

Data Filters .................................................................................................................................... 11

Understanding Config.CSV file ...................................................................................................... 12

Reference Screenshots ................................................................................................................. 13

Google Developers Console: Obtaining Client ID and Secret ................................................... 13

Config.csv file containing URL request Parameters .................................................................. 13

Few common APIs list to obtain IDs .............................................................................................. 14

Creating a connection for Linux Agent .......................................................................................... 14

Config Prop file Screenshot ....................................................................................................... 17

Troubleshooting ............................................................................................................................. 18

Increasing Secure Agent Memory.............................................................................................. 18

Additional Guidelines ................................................................................................................. 19

Page 3: Google API Connector UserGuide

3

Overview

Informatica cloud connector SDKs are off-cycle, off release “add-ins” that provide data integration to SaaS and on-premise applications, which are not supported natively by Informatica cloud. The cloud connectors are specifically designed to address most common use cases such as moving data into cloud and retrieving data from cloud for each individual application.

Figure 1. Informatica Cloud Architecture

Once the Google API cloud connector is enabled for your ORG Id, you need to create a connection in Informatica cloud to access the connector.

Google API Connector

Google API connector integrates Google end point. The connector can fetch/read information from Google analytics and AdSense management API’s.

Note: For all the APIs look-up is not supported. Data preview is supported for all APIs.

Enabling Google API Connector

To enable Google API connector, get in touch with Informatica support or Informatica representative. It usually takes 15 minutes for the connector to download to secure agent, after it is enabled.

Note: To install secure agent, see Installing Informatica Secure Agent.

Page 4: Google API Connector UserGuide

4

API’s supported by the connector

Currently, the connector support Google’s Analytics and AdSense APIs. The lists of supported API’s are given below.

Note: If you want the connector to support other Google APIs, contact Informatica Cloud support.

The following picture lists the available Google analytics API’s.

Figure 2. Supported Google Analytics API

For more information on supported API’s, see: Google Developers Console.

Note: All the APIs support only ‘Insert’ (Fetch/Read) task operation. Note: For all the APIs look-up is not supported. Data preview is supported for all APIs.

Page 5: Google API Connector UserGuide

5

The following picture lists the available Google AdSense API’s.

Figure 3. Supported Google Analytics API

For more information on supported API’s, see: Google Developers Console.

Note: All the APIs support only ‘Insert’ (Fetch/Read) task operation.

Note: For all the APIs look-up is not supported. Data preview is supported for all APIs.

Page 6: Google API Connector UserGuide

6

Creating a Google API Connection

To use Google API connector in data synchronization task, you must create a connection in Informatica Cloud. See Also: Creating a connection for Linux environment.

The following steps help you to create Google API connection in Informatica Cloud.

1. In Informatica Cloud home page, click Configure.

2. The drop-down menu appears, select Connections.

3. The Connections page appears.

4. Click New to create a connection.

5. The New Connection page appears.

Figure 4. Creating a new connection

6. Specify the following details.

Page 7: Google API Connector UserGuide

7

Connection Property Description

Connection Name Enter a unique name for the connection.

Description Provide a relevant description for the connection.

Type Select Google API from the list.

Secure Agent Select the appropriate secure agent from the list.

Google API Select the Google API you wish to use from the list of available API’s. See Few common APIs list to obtain IDs

Is Google API Dynamic Tick the checkbox to make the API dynamic (Mandatory).

URL Request Parameters

Enter URL request parameters. For example,

‘Max-results=10;start-index=0’. The URL request parameters will be present in the config.csv file created. See Config.csv file containing URL request Parameters

Request Type By default ‘POST’ is selected. Only ‘POST’ is supported in the current release. POST helps you to perform Read/Fetch operations. Other options will be supported in upcoming releases.

Client ID Enter Client ID obtained from Google Developers Console.

Client Secret Key Enter Client Secret obtained from Google Developer Console.

Authorization Code

Authorization code for windows agent is automated. You do not have to enter authorization code, when you use windows secure agent. When you want to use connector using Linux agent, then use manual method of authenticating Google API. See Creating a connection for Linux Agent

Response Folder Path Enter Response folder path where file containing summary of DSS task will be created.

URL Input Parameters Config File Name

Enter Config folder path with file name. Config file contains details about connection and end-point reference.

Secure Credentials File Name

Enter Secure Credentials File folder path with file name. When you test the connection Secure Credentials File will be generated.

Example: \..\..\GoogleAPI\Secure_Credentials.cfg

Create the config csv file

Select ‘Yes’ and then test the connection.

A configuration file containing API details will be created in the mentioned folder path.

Once the configuration file is created, select ‘No’ and proceed with creating a connection.

Note: You need to create a new config csv file, for every Google API you choose.

Authentication Required

Select ‘Yes’ only for the first time you create a Google API connection in Informatica cloud and then test the connection.

A browser window opens up requesting access to Google API. Click ‘Access’ and proceed with creating a connection.

After authentication, select ‘No’ and then proceed to create a connection.

Page 8: Google API Connector UserGuide

8

7. Click Test to evaluate the connection.

Note: When you test the connection, config.csv and secure credentials file will be generated in respective folder paths.

Figure 5. Sample Config CSV File

8. After connection test is successful, select ‘NO’ in Create the config csv file and Authentication Required fields.

9. Click Ok to save the connection.

Creating Google API Data Synchronization Task

Note: You need to create a connection before getting started with data synchronization task.

The following steps help you to setup a data synchronization task in Informatica Cloud.

Note: The first DSS task you will perform using the connector will be to fetch the Account ID. You need to select ‘Lists_all_accounts_to_which_the_user_has_access’ in Google API while creating a connection.

The account ID and likewise other IDs needs to be entered in the Config.csv file to get different Google APIs while creating a connection. Otherwise the DSS task will not run as expected. See Understanding Config.CSV file.

Let us consider the task operation Insert (Fetch/Read) to perform the Data synchronization task.

1. In Informatica Cloud home page, click Applications.

2. The drop-down menu appears, select Data Synchronization.

3. The Data Synchronization page appears.

4. Click New to create a data synchronization task.

5. The Definition tab appears.

Figure 6. Definition Tab

Page 9: Google API Connector UserGuide

9

6. Specify the Task Name, provide a Description and select the Task Operation Insert.

7. Click Next.

8. The Source tab appears.

Figure 7. Source Tab

9. Select the source Connection, Source Type and Source Object to be used for the task.

10. Click Next.

11. The Target tab appears. Select the target Connection and Target Object required for the

task.

Figure 8. Target Tab

Page 10: Google API Connector UserGuide

10

12. Click Next.

13. In Data Filters tab by default, Process all rows is chosen. See Also Data Filters. It is mandatory to assign ‘_FLT_URL_Input_Parameters_Config_File_Path’ data filter in DSS

task.

14. Click Next.

15. In Field Mapping tab, map source fields to target fields accordingly.

Figure 9. Field Mapping

16. Click Next.

17. The Schedule tab appears.

18. In Schedule tab, you can schedule the task as per the requirement and save.

19. If you do not want schedule the task, click Save and Run the task.

Figure 10. Save and Run the Task

After you Save and Run the task, you will be redirected to monitor log page. In monitor log page, you can monitor the status of data synchronization tasks.

Page 11: Google API Connector UserGuide

11

Data Filters

Data filters help you to fetch specific data based on the APIs configured in Config.csv file.

The data synchronization task will process the data based on the filter field assigned. See Understanding Config.CSV file.

It is mandatory to assign ‘_FLT_URL_Input_Parameters_Config_File_Path’ filter field while setting up a DSS task.

Note: Advanced data filters are not supported Google API connector

The following steps help you to use data filters.

1. In Data synchronization task, select Data Filters tab.

2. The Data Filters tab appears.

3. Click New as shown in the figure below.

Figure 11. Data Filters

4. The Data Filter dialog box appears.

Figure 12. Data Filters-2

Page 12: Google API Connector UserGuide

12

5. Specify the following details.

Field Type Description

Object Select Object for which you want to assign filter fields

Filter By Select the Filter Field

Operator Select Equals operator. Only Equals operator is supported with this release.

Filter Value Enter the Filter value

6. Click Ok.

Understanding Config.CSV file

The config.csv file contains all the configuration parameters of the Google APIs. When you want to fetch data from different Google APIs, you need to obtain different IDs as a key to access other Google APIs.

While creating a connection, you generate a config.csv file. You need to update the config.csv file with IDs obtained from previous DSS tasks for the DSS task to be executed successfully. The IDs will be present in target .csv file.

Note: When you want to fetch Account ID which is the base to obtain all other IDs, you need not enter any ID in the config.csv file created to fetch Account ID. To fetch Account ID, select ‘Lists_all_accounts_to_which_the_user_has_access’ in Google API while creating a connection.

Let us consider an example to understand updating Config.csv file.

1. At first, let us assume you have obtained Account ID by executing a DSS Task. The account ID is obtained from target .CSV file.

Figure 13. Obtaining Account ID

2. When you want to obtain Web properties ID, create a Google API connection selecting Google API ‘Lists_web_properties_to_which_the_user_has_access’.

3. The following Config.csv file will generated while creating a connection.

Figure 14. Web Properties

Page 13: Google API Connector UserGuide

13

4. Update the config.csv file with Account ID obtained.

Figure 15. Entering Account ID

5. Now setup the DSS task successfully.

Reference Screenshots

Google Developers Console: Obtaining Client ID and Secret

Figure 16. Google Developers Console

Config.csv file containing URL request Parameters

Figure 17. URL Request Parameters

Page 14: Google API Connector UserGuide

14

Few common APIs list to obtain IDs

Google API ID Obtained

Lists_all_accounts_to_which_the_user_has_access Account ID

Lists_web_properties_to_which_the_user_has_access Web Properties ID

Lists_views_profiles_to_which_the_user_has_access Profile ID

Lists_goals_to_which_the_user_has_access Goal ID

Lists_experiments_to_which_the_user_has_access Experiment ID

Creating a connection for Linux Agent

When you create a connection for Linux environment, you need to manually authorize the Google API.

The following information helps you to manually authorize the Google API.

1. Create a Batch file by pasting the content given below. For example: Google_API.bat.

Batch file content for Google analytics API

start chrome

https://accounts.google.com/o/oauth2/auth?redirect_uri=http://localhost:4000&re

sponse_type=code&client_id=<Mention your client

ID>.apps.googleusercontent.com&scope=https://www.googleapis.com/auth/analytics

https://www.googleapis.com/auth/analytics.edit

https://www.googleapis.com/auth/analytics.manage.users

https://www.googleapis.com/auth/analytics.readonly&approval_prompt=force&access

_type=offline

Batch file content for Google AdSense API

start chrome

https://accounts.google.com/o/oauth2/auth?redirect_uri=http://localhost:4000&re

sponse_type=code&client_id=<Mention your client

ID>.apps.googleusercontent.com&scope=scope=https://www.googleapis.com/auth/adse

nsehttps://www.googleapis.com/auth/adsense.readonly&approval_prompt=force&acces

s_type=offline

Note: Mention the redirect_uri used in the secure credentials file. It is recommended to use http://localhost:4000 as it is an unused port.

Note: The scope URL is different for Google analytics and AdSense API.

2. Click the Batch file.

3. Project Default Service Account browser window opens up.

4. Click Accept to access Google API.

5. Once you click Accept, you will be redirected to following page as shown below. The page URL also contains the authorization code.

Page 15: Google API Connector UserGuide

15

Figure 18. Authorization Code

6. Copy and paste the code in Authorization Code while Creating a Google API connection.

Figure 18. Authorization Code

Page 16: Google API Connector UserGuide

16

7. Specify the following details.

Connection Property Description

Connection Name Enter a unique name for the connection.

Description Provide a relevant description for the connection.

Type Select Google API from the list.

Secure Agent Select the appropriate secure agent from the list.

Google API Select the Google API you wish to use from the list of available API’s. See Few common APIs list to obtain IDs

Is Google API Dynamic Tick the checkbox to make the API dynamic (Mandatory).

URL Request Parameters

Enter URL request parameters. For example,

‘Max-results=10;start-index=0’. The URL request parameters will be present in the config.csv file created. See Config.csv file containing URL request Parameters

Request Type By default ‘POST’ is selected. Only ‘POST’ is supported in the current release. POST helps you to perform Read/Fetch operations. Other options will be supported in upcoming releases.

Client ID Enter Client ID obtained from Google Developers Console.

Client Secret Key Enter Client Secret obtained from Google Developer Console.

Authorization Code When you want to use connector in Linux environments, then use manual method of authenticating Google API. See Creating a connection for Linux environment.

Response Folder Path Enter Response folder path where file containing summary of DSS task will be created.

URL Input Parameters Config File Name

Enter Config folder path with file name. Config file contains details about connection and end-point reference.

Secure Credentials File Name

Enter Secure Credentials File folder path with file name. When you test the connection Secure Credentials File will be generated.

Example: \..\..\GoogleAPI\Secure_Credentials.cfg

Create the config csv file

Select ‘Yes’ and then test the connection.

A configuration file containing API details will be created in the mentioned folder path.

Once the configuration file is created, select ‘No’ and proceed with creating a connection.

Note: You need to create a new config csv file, for every Google API you choose.

Authentication Required

Select ‘Yes’ only for the first time you create a Google API connection in Informatica cloud and then test the connection.

After authentication, select ‘No’ and then proceed to create a connection.

Page 17: Google API Connector UserGuide

17

8. Most of the connection parameters are identical to creating a connection in windows environment. Note: In the above connector parameter description, go through Authentication Required property details.

9. Click Test to evaluate the connection.

10. After connection test is successful, select ‘NO’ in Create the config csv file and Authentication Required fields.

11. Click Ok to save the connection.

Config Prop file Screenshot

The URLs in Batch file are same as the URLs present in config.properties files. The following picture represents the config.properties file.

Figure 19. Config Prop File

Page 18: Google API Connector UserGuide

18

Troubleshooting

Increasing Secure Agent Memory To overcome memory issues faced by secure agent follow the steps given below.

1. In Informatica Cloud home page, click Configuration.

2. Select Secure Agents.

3. The secure agent page appears.

4. From the list of available secure agents, select the secure agent for which you want to increase memory.

5. Click pencil icon corresponding to the secure agent. The pencil icon is to edit the secure

agent.

6. The Edit Agent page appears.

7. In System Configuration section, select the Type as “DTM”.

8. Edit JVMOption1 as “-Xmx512m” as shown in the figure below.

Figure 20. Increasing Secure Agent Memory-1

9. Again in System Configuration section, select the Type as “TomCatJRE”.

10. Edit INFA_memory to “-Xms256m -Xmx512m” as shown in the figure below.

Page 19: Google API Connector UserGuide

19

Figure 21. Increasing Secure Agent Memory-2

11. Restart the secure agent.

The secure agent memory has been increased successfully.

Additional Guidelines

When you get an error saying invalid credentials while creating a connection, test the connection to authorize the Google API again. You can also manually authorize the connection, if required.

Check the Config prop file to know whether the connection is authorized or not.

It is recommended to clear the browsing history, cookies and session information of the web browser before getting started with Google API connector.