skip to main content
Using DataDirect Hybrid Data Pipeline : Creating a Data Source definition : Google Analytics parameters
  

Try Now

Google Analytics parameters

Google APIs use OAuth 2.0 protocol for authentication and authorization. OAuth is an open standard for authorization. It provides client applications (in this case Hybrid Data Pipeline) secure access to server resources (such as Google Analytics) on behalf of a resource owner. To connect to Google Analytics through OAuth 2.0 protocol, the administrator needs to set up a project at Google console.
Next, the administrator must create an OAuth application. This involves creating a client ID and client secret pair. The administrator must then register this pair with Hybrid Data Pipeline using the REST API.

Creating an OAuth application (for administrators only)

1. Launch the Google Developer Console and log in using your Google account credentials.
2. Make sure that the Analytics API under Library > Other populer APIs >Analytics API is enabled for this account.
3. Create a new project.
4. In the project, click the Credentials section on the left.
5. Click the OAuth consent screen tab, enter the required details, including the product name, and then click Save.
6. In the Credentials tab, click Create credentials > OAuth client ID.
7. In the Create client ID screen, select Web application in the Application type section and specify the Hybrid Data Pipeline URL--<protocol>:<Your_Hybrid Data Pipeline_Server>:<port-number>/d2c-ui/oauth--in the Authorized redirect URIs setting. Ensure that the domain name is fully qualified. Then, click Create.
Note: In case you are using Hybrid Data Pipeline on multiple nodes behind a load balancer, you will need to specify the Load Balancer URL as the redirect URL. The Load Balancer URL followed by /d2c-ui/oauth will be the redirect URL. If the port number is unspecified, the default port will be 443 for https and 8080 for http.
8. Copy the client ID and secret key to a text editor.
Note: You will need these credentials while registering the OAuth application with Hybrid Data Pipeline.
9. Click Library in the left pane and in the page that appears on the right, click the Analytics API link.
10. In the Analytics page that appears, enable the APIs that you need by using the Enable button.

Registering the OAuth application with Hybrid Data Pipeline (for administrators only)

To register the OAuth application with Hybrid Data Pipeline, you must make a REST call to the Hybrid Data Pipeline Server. You can use any REST client that you are familiar with. Use the following details:
*Method: POST
*URL: <Your_Hybrid_Data_Pipeline_Server>/mgmt/oauthapps
*Authorization: Hybrid Data Pipeline Admin credentials
*Sample Request:
{
"name": "<name>",
"dataStore": 54,
"description": "<description>",
"clientId": "<clientId>",
"clientSecret": "<clientSecret>"
}

Creating the Google Analytics data source definition

After the administrator has set up OAuth authentication, add a Google Analytics data store in your Hybrid Data Pipeline user interface.
The following sections describe the parameters available on the General and Mapping tabs of a Google Analytics Data Source dialog.

General tab

General tab of the Google Analytics data source setup dialogGeneral tab of the Google Analytics data source setup dialog
Table 19. General tab connection parameters for Google Analytics
Field
Description
Data Source Name
A unique name for this Data Source definition.
Note: Names can contain only alphanumeric characters and underscores.
Description
A description of this set of connection parameters.
OAuth Profile Name
In some environments, you might want to reuse connections for users who have different access privileges. You can create separate profiles for different users.
Select an OAuth profile name from the drop-down list, or create a new profile by clicking Create New Profile in the dropdown list, entering a profile name, and then clicking the Add icon. Then, click Authorize with Google.
When you select an OAuth Profile Name that has been authorized with Google, the Default View Name and Segment fields get populated.
Default View Name
A view that belongs to your Google Analytics account. Select a view from the drop-down list.
Segment
A segment that belongs to your Google Analytics account. Select a segment from the drop-down list.
Start Date
The start date for fetching Google Analytics data (inclusive). You can enter a specific date in YYYY-MM-DD format, or select a date, using the calendar icon. Alternatively, select a relative value (Today, Yesterday, or N Days Ago, where N is a positive integer). The default is 30 days prior to the current date.
End Date
The end date for fetching Google Analytics data. You can enter a specific date in YYYY-MM-DD format, or select a date, using the calendar icon. Alternatively, select a relative value from the drop-down list (Today, Yesterday, or N Days Ago, where N is a positive integer).
The end date must always be later than the start date, if a start date is specified.

Mapping tab

The Mapping tab enables you to create relational tables in Hybrid Data Pipeline and map them to Metrics and Dimensions in your Google Analytics data source.
Mapping tab of the Google Analytics data source setup dialogMapping tab of the Google Analytics data source setup dialog
Table 20. Mapping tab connection parameters for Google Analytics
Field
Description
Map Name
Optional name of the map definition that Hybrid Data Pipeline uses to interpret the schema of the data store. The Hybrid Data Pipeline service automatically creates a name for the map. If you want to name the map yourself, enter a unique name.
Refresh Schema
The Refresh Schema checkbox specifies whether the connectivity service attempts to refresh the schema when an application first connects.
Valid Values:
When the check box is selected (set to true), the connectivity service attempts to refresh the schema.
When the check box is not selected (set to false), the connectivity service does not attempt to refresh the schema.
Default
false
Notes
*You can choose to refresh the schema by clicking the Refresh button: This refreshes the schema immediately. Note that the refresh option is available only while editing the Data Source.
*Use the checkbox to specify whether the connectivity service attempts to refresh the schema when an application first connects. Use the button if you want to refresh the schema immediately, using an already saved configuration.
*If you are making other edits to the settings, you need to click update to save your configuration. The Refresh schema button will only trigger a runtime call on the saved configuration.
Create Mapping
Determines whether the Google Analytics table mapping files are to be (re)created.
Hybrid Data Pipeline automatically maps data store objects and fields to tables and columns the first time that it connects to the data store. The map includes both standard and custom objects and includes any relationships defined between objects.
Table 20. Valid values for Create Map field
Value
Description
Not Exist
Select this option for most normal operations. If a map for a data source does not exist, this option causes one to be created. If a map exists, the service uses that existing map. If a name is not specified in the Map Name field, the name will be a combination of the User Name and Data Source ID.
Force New
Select this option to force creation of a new map. A map is created on connection whether one exists or not. The Hybrid Data Pipeline connectivity service uses a combination of the User Name and Data Source ID to name the map. Map creation is expensive, so you will likely not want to leave this option set to Force New indefinitely.
No
If a map for a data source does not exist, the connectivity service does not create one.
Add Tables
A set of tables to work with your Google Analytics account.
To create configuration tables that use different combinations of Metrics and Dimensions, click the Configure Logical Schema button.
In the Configure Logical Schema screen, click Create Table and enter a name for the table.
In the Dimensions and Metrics screen, select the metrics that you want to add to the table. You can select metrics across multiple dimensions. Each metric gets added as a column in the table.
Finally, click Save & Close.
Show Deprecated Objects
Defines whether Hybrid Data Pipeline shows deprecated objects. Google Analytics marks dimensions and metrics as deprecated as an indication that they plan to remove support for those objects. By default, the Hybrid Data Pipeline connectivity service does not expose these deprecated objects. Set the value to true while you work on rewriting your queries and table definitions to migrate from the deprecated objects. Once the queries and table definitions are fixed, change the setting for the map option back to false.
Valid Values:
true | false
If the check box is selected (true), Hybrid Data Pipeline includes deprecated objects in the relational model.
If the check box is not selected (false), Hybrid Data Pipeline does not include deprecated objects in the relational model.
Default: false
Show Internal Tables
Defines how Hybrid Data Pipeline shows internal tables.
Valid Values:
true | false
If the check box is selected (true), Hybrid Data Pipeline shows the "Data" table.
If the check box is not selected (false), Hybrid Data Pipeline does not show the "Data" table.
Default: false
Subtract Tables
Defines a comma-separated list of tables that should be hidden from the user's view. This feature is useful if you want to define your own tables instead of using some of the tables that are supplied with the data store, or to limit access to certain tables so that the user does not see them. For example, enter adSense,adWords.
subtractTables can be used both for the pseudo-tables in Google Analytics that are derived from the Data system table, and also for the regular management tables such as Goal or Account.
* Adding Google Analytics tables
* Using Google Analytics
* Defining OAuth2 authentication
* Creating an OAuth profile
* Renaming an OAuth profile
* Deleting an OAuth profile