GOOGLE ANALYTICS CUSTOM DATA SOURCE PROVIDER FOR TX DWA All product names mentioned in this document may be (registered) trademarks of their respective companies. TimeXtender 2016. Version 2016-07-06.
Contents Introduction... 2 Installation... 2 Usage... 3 Authenticating with Google through OAuth... 3 Setting up a Custom Data Source... 7 Introduction The Google Analytics provider enables you to extract data from Google Analytics a custom data source in TX DWA. The provider uses the Google Analytics ADO.NET Provider from CData, which you have to download and install separately. For more information, see CData s website: http://www.cdata.com/drivers/ganalytics/ado/ Installation The provider is installed through the Custom Components setup application available at the TimeXtender support site: https://support.timextender.com/hc/en-us/articles/209604866 TimeXtender 2016. Version 2016-07-06. 2
Usage When you have installed the provider, you have to set up authentication with Google. You can then add a custom data source that uses the provider and begin to extract data from Google Analytics for use in your project. Authenticating with Google through OAuth To access Google Analytics data, you have to set up OAuth authentication with Google. This only has to be done once for each Google Analytics account. Setting up Authentication Follow the steps below to create a client and get your OAuth client ID and client secret. 1. Visit https://console.developers.google.com/ and log in with a Google Account that has access to the Google Analytics account you will be extracting data from. 2. Click Select a Project in the top menu and then click Create a Project Fill in the form and click Create. TimeXtender 2016. Version 2016-07-06. 3
3. Type analytics in the search box on the Overview page and click Analytics API when is displayed in the results list. 4. Click Enable API. 5. Click Go to Credentials after enabling the API. TimeXtender 2016. Version 2016-07-06. 4
6. Click OAuth consent screen. Type a name in Product name shown to users and click Save. 7. Click Credentials, click Create credentials and then click OAuth client ID. TimeXtender 2016. Version 2016-07-06. 5
8. Select Other under Application type and type a name for the application. 9. The client ID and client secret is displayed. You can keep your browser open on this page to easily copy the id and secret to TX DWA. If you need to find them later, you can review the credentials on the Credentials page. TimeXtender 2016. Version 2016-07-06. 6
Setting up a Custom Data Source When you have acquired a client ID and client secret, you are ready to use the provider in TX DWA. Adding a Google Analytics Custom Data Source To add and configure a custom data source using the provider, follow the steps below. 1. On the Data tab, right click Data Sources, and then click Add Custom Data Source. Add Custom Data Source opens. 2. In the Provider list, click TimeXtender Google Analytics. 3. In the Setup Property list, make sure Connection String is selected. 4. Under Authentication, in the Profile row, enter the view ID you want to extract data from. If you do not specify view, the first one that the user has access to will be used. 5. Under OAuth, set Initiate OAuth to GETANDREFRESH and enter the OAuth Client ID and OAuth Client Secret. 6. Click Test Connection. TX DWA will open a browser window on the Google accounts site. Log in with a Google account that have access to the data you want to extract and the click Allow on the [product name] would like to: View your TimeXtender 2016. Version 2016-07-06. 7
Google Analytics data page. TimeXtender 2016. Version 2016-07-06. 8
Extracting Data from Multiple Accounts You can extract data from multiple Google Analytics accounts. Follow the steps below to configure the custom data source to get data from more than one account. 1. Right click your Google Analytics custom data source and the click Edit. 2. Under Authentication, remove any view ID you have previously entered in the Profile row. 3. In the Setup property list, click Additional settings. Set Add ProfileId column to True. TimeXtender 2016. Version 2016-07-06. 9
4. Right click your Google Analytics custom data source and the click Set up profiles. 5. In the profiles list, select the views you want to extract data from. 6. Click OK. 7. Right click the data source and click Synchronize Objects to add the new views. TimeXtender 2016. Version 2016-07-06. 10
Setting the Maximum Length of Strings With standard settings, it will result in an error if Google Analytics returns a string longer than 2000 characters. To set a new maximum length, follow the steps below 1. Right click your Google Analytics custom data source and the click Edit. 2. In the Setup property list, click Additional settings. 3. Set Override string data type length to True. 4. In the Override string data type value row, enter the new maximum string length. 5. Click OK. TimeXtender 2016. Version 2016-07-06. 11