<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>google analytics Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/google-analytics/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/google-analytics/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 17 Apr 2025 14:27:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>google analytics Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/google-analytics/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Import Google Analytics data into SQL Server / Reporting / ETL</title>
		<link>https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 25 May 2019 19:17:14 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[T-SQL (SQL Server)]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[openquery]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[ssms]]></category>
		<category><![CDATA[ssrs]]></category>
		<category><![CDATA[t-sql]]></category>
		<category><![CDATA[tableau]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7003</guid>

					<description><![CDATA[<p>Introduction In our previous article we saw how to read Google Analytics data using SSIS. But what if you don&#8217;t use SSIS and you still like to Import Google Analytics data into SQL Server or Read inside other Reporting / ETL Apps (e.g. Excel, Power BI, MS Access &#8230; and many more). Not all BI [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/">Import Google Analytics data into SQL Server / Reporting / ETL</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png"><img decoding="async" class=" wp-image-7056 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png" alt="" width="162" height="162" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo.png 250w, https://zappysys.com/blog/wp-content/uploads/2019/05/google-analytics-logo-150x150.png 150w" sizes="(max-width: 162px) 100vw, 162px" /></a>In our previous article we saw how to <a href="https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/">read Google Analytics data using SSIS</a>. But what if you don&#8217;t use SSIS and you still like to Import Google Analytics data into SQL Server or Read inside other Reporting / ETL Apps (e.g. Excel, Power BI, MS Access &#8230; and many more). Not all BI tools comes with native driver / connectivity for Google Analytics. Sometimes they do offer Google Analytics connectivity but don&#8217;t offer feature you looking for (e.g. Sort, Segment Filter). In such case you have to look for solution outside.</p>
<p>Well not to worry we will show you how simple it is to connect to Google Analytics using <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ZappySys JSON Driver (For REST API / Files)</a> in few mins. This driver is one of the best REST API drivers you can find in the market. It is so generic that it can virtually access any REST API you may find internally or on public sites (e.g. Facebook, Salesforce, Azure, AWS). Check <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-drivers/json-rest-api-driver/" target="_blank" rel="noopener">these articles</a> to see many more use cases of JSON Driver.</p>
<p>At the end of this article you will learn how to Query Google Analytics data in <strong>SSMS</strong> like below (Yes that&#8217;s correct .. Pretty Awesome!!! ).</p>
<div id="attachment_7046" style="width: 649px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7046" class="size-full wp-image-7046" src="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png" alt="Import Google Analytics Data into SQL Server Table (using T-SQL Code)" width="639" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png 639w, https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server-300x253.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></a><p id="caption-attachment-7046" class="wp-caption-text">Import Google Analytics Data into SQL Server Table (using T-SQL Code)</p></div>
<div class="content_block" id="custom_post_widget-7048"><h2>Requirements</h2>
This article talks about few tools and techniques in order to load API data in SQL Server. Please make sure following prerequisites are met.
<ol>
 	<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> (This includes XML / JSON / REST API and few other drivers for SQL Server and ODBC connectivity in tools like Excel, Power BI, SSRS)</li>
 	<li>Make sure you have access to SQL Server Instance. If you cant find one still want to try what is mentioned in this article then install <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express" target="_blank" rel="noopener">FREE SQL Express Edition</a></li>
 	<li>Confirm that you have SSMS Installed. If you don't have then you can download <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017">from here</a>.</li>
</ol></div>
<h2>Testing Google Analytics API</h2>
<p>If you are new to Google Analytics API then read little bit about <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#data_request" target="_blank" rel="noopener">Google Analytics REST API here</a>. Google also offers a really good way to test Analytics API using <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">Query Explorer Tool here</a>. So please check that and understand how to craft correct REST API URL which will be used in the next section.</p>
<div id="attachment_7021" style="width: 908px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7021" class="size-full wp-image-7021" src="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png" alt="Using Google Analytics Query Explorer Tool - Create REST API Url (Dimension / Metrics Selection Browser)" width="898" height="1379" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer.png 898w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-195x300.png 195w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-768x1179.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/05/generate-google-analytics-rest-api-url-query-explorer-667x1024.png 667w" sizes="(max-width: 898px) 100vw, 898px" /></a><p id="caption-attachment-7021" class="wp-caption-text">Using Google Analytics Query Explorer Tool &#8211; Create REST API Url (Dimension / Metrics Selection Browser)</p></div>
<h3>Sample Google Analytics API Response</h3>
<p>Behind the scene here is how API Request and Response Looks like for Google Analytics REST API. Notice that <strong>Authorization</strong> Header in below request is automatically added by ZappySys Driver or Query Testing tool above. Also notice <strong>nextLink</strong> attribute in response, its used to fetch more data. By default each response contains upto 10000 rows.</p>
<p><strong>Request</strong></p><pre class="crayon-plain-tag">GET https://www.googleapis.com/analytics/v3/data/ga?ids=ga:185737326&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration&amp;dimensions=ga:date
Authorization: Bearer ya29.GlwUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</pre><p>
<strong>Response</strong></p><pre class="crayon-plain-tag">{
    "kind": "analytics#gaData",
    "id": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday",
    "query": {
        "start-date": "30daysAgo",
        "end-date": "yesterday",
        "ids": "ga:123456789",
        "dimensions": "ga:date",
        "metrics": ["ga:avgSessionDuration"],
        "start-index": 1,
        "max-results": 1000
    },
    "itemsPerPage": 1000,
    "totalResults": 30,
    "selfLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday",
    "nextLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123456789&amp;dimensions=ga:date&amp;metrics=ga:avgSessionDuration&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;start-index=10001&amp;max-results=10000",
    "profileInfo": {
        "profileId": "123456789",
        "accountId": "33445566",
        "webPropertyId": "UA-33445566-3",
        "internalWebPropertyId": "454545454",
        "profileName": "All Web Site Data",
        "tableId": "ga:123456789"
    },
    "containsSampledData": false,
    "columnHeaders": [
        {
            "name": "ga:date",
            "columnType": "DIMENSION",
            "dataType": "STRING"
        },
        {
            "name": "ga:avgSessionDuration",
            "columnType": "METRIC",
            "dataType": "TIME"
        }
    ], "totalsForAllResults": {
        "ga:avgSessionDuration": "49.3779488037477"
    },
    "rows": [ 
		["20190425", "401.38912133891213"], 
		["20190426", "512.49723756906077"], 
		["20190427", "11.53488372093024"], 
		["20190428", "432.148648648648646"], 
		["20190429", "234.650735294117645"],
		.......
		.......
		.......
		.......
		["20190525", "74.123435294117645"]
	]
}</pre><p>
&nbsp;</p>
<h2>Creating Google API Project (Obtain Client ID / Secret)</h2>
<p>Very first step to call any Google API including Google Analytics is to create Google API Project and register OAuth App to obtain <strong>Client ID</strong> and <strong>Client Secret</strong>. If you dont want to go through this hassle and start easy way then ZappySys offers Inbuilt Default App on <strong>OAuth</strong> Connection UI but <strong>we strongly recommend</strong> you create your own app rather than using Default App because in Default App API call limit is shared by many. Your data is never shared with ZappySys in any case even you use Default App.</p>
<p>Here is how to <a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/">create API Project to call Google API</a>. Once you create Google API Project make sure you <strong>enable</strong> <strong>Google Analytics API</strong>.</p>
<p>So once you have <strong>Client ID</strong> and <strong>Client Secret</strong> we can move forward to the next step.</p>
<h2>Loading Google Analytics data into SQL Server</h2>
<p>In our previous article we saw in depth general idea on how to <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/">import REST API data in SQL Server (T-SQL Script)</a> without relying on any ETL tools.  Now lets look at step by step on <strong>how to load Google Analytics data into SQL Server</strong>.</p>
<p>In this example, our goal is to extract a Google Analytics report which shows average session duration and new users count by date (For last 30 days).</p>
<h3>Setup ZappySys Data Gateway</h3>
<p>Very first step to access any REST API Data inside SQL Server is to configure ZappySys Data Gateway. We covered this in <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">previous article</a>.  But here are high level steps for initial setup of Data Gateway.</p>
<ol>
<li>Search for Gateway in Start menu and  Select ZappySys Data Gateway
<div id="attachment_5283" style="width: 410px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5283" class="size-full wp-image-5283" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" width="400" height="315" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png 400w, https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway-300x236.png 300w" sizes="(max-width: 400px) 100vw, 400px" /></a><p id="caption-attachment-5283" class="wp-caption-text">Open ZappySys Data Gateway</p></div></li>
<li>Create <strong>new User</strong> in Data gateway on Users tab. Enter username and password (we will use this when we create Linked Server) . <strong><strong><strong>Check Admin Option</strong></strong></strong>
<div id="attachment_5285" style="width: 426px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5285" class="size-full wp-image-5285" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png" alt="Add Data Gateway User" width="416" height="444" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png 416w, https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user-281x300.png 281w" sizes="(max-width: 416px) 100vw, 416px" /></a><p id="caption-attachment-5285" class="wp-caption-text">Add Data Gateway User</p></div></li>
</ol>
<h3>Setup Google Analytics API Data Source in Gateway / ODBC</h3>
<p>Once gateway user is setup, now lets create a new Data Source for Google Analytics API. In this section we will talk how to create data source in gateway but most instructions can be used to create data source in ODBC too. At the end of this article we explained how to Launch ODBC Datasource UI. Step#1 and 2 are only different, all other steps same in ODBC DSN creation.</p>
<ol>
<li>Click Add Data Source option (Select Native &#8211; JSON Driver )
<div id="attachment_5284" style="width: 568px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5284" class="size-full wp-image-5284" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png" alt="Add Gateway Data Source (Native JSON Driver)" width="558" height="533" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source.png 558w, https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-data-source-300x287.png 300w" sizes="(max-width: 558px) 100vw, 558px" /></a><p id="caption-attachment-5284" class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p></div></li>
<li>Click Edit to configure data source
<div id="attachment_5440" style="width: 572px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5440" class="size-full wp-image-5440" src="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png" alt="Edit Gateway Data Source Settings" width="562" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/11/gateway-create-datasource-2-2-300x206.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-5440" class="wp-caption-text">Edit Gateway Data Source Settings</p></div></li>
<li>Now lets configure Driver settings.  Click on Load Connection String button.
<div id="attachment_7024" style="width: 996px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7024" class="size-full wp-image-7024" src="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png" alt="Load ZappySys Driver ConnectionString to configure UI" width="986" height="454" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring.png 986w, https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring-300x138.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/zappysys-driver-load-connectionstring-768x354.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a><p id="caption-attachment-7024" class="wp-caption-text">Load ZappySys Driver ConnectionString to configure UI</p></div></li>
<li>Enter the following ConnectionString to get started with predefined settings.<br />
Change ids (<strong>111223344</strong> to your own Profile ID in <strong>DataPath URL</strong>). Other URL Parameters explained in next section.<br />
<pre class="crayon-plain-tag">DRIVER={ZappySys JSON Driver};
DataPath='https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date';
DataConnectionType=OAuth;
ScopeSeparator='{space}';
Scope='https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.readonly';
ServiceProvider=Google;
Filter='$.rows[*]';
ArrayTransformType=TransformSimpleTwoDimensionalArray;
ArrayTransColumnNameFilter='$.columnHeaders[*].name';
RequestMethod='GET';
NextUrlAttributeOrExpr='$.nextLink';
ClientId='xxxxxxxxxxxx';
ClientSecret='yyyyyyyyyyyyyy';
UseCustomApp='True'</pre>
&nbsp;</li>
<li>URL used in DataPath is most important (parameters explained below) . You can use   <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">Query Explorer Tool here</a> to build same URL.<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date</pre>
<strong><span style="text-decoration: underline;">Parameters Explained </span><br />
</strong><br />
Here is some required parameters used in above REST API URL.<br />
<strong>ids</strong>=ga:11223344<br />
This is your Profile ID which you like to extract.  <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#ids">Read more</a><strong><br />
start-date</strong>=30daysAgo<br />
This can be yyyy-MM-dd or some other some predefined date keywords (e.g today, yesterday 10daysAgo). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#startDate" target="_blank" rel="noopener">Read more</a>.<br />
<strong>end-date</strong>=yesterday<br />
Same as above<br />
<strong>metrics</strong>=ga:avgSessionDuration,ga:newUsers<br />
This can be comma separated list of metrics you like to extract (max 10). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#metrics" target="_blank" rel="noopener">Read more</a>.<br />
<strong>dimensions</strong>=ga:date<br />
This can be comma separated list of metrics you like to extract (max 7). <a href="https://developers.google.com/analytics/devguides/reporting/core/v3/reference#dimensions" target="_blank" rel="noopener">Read more</a>.</li>
<li>Now its time to configure <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">OAuth</a> settings. Click on Configure Connection. Enter Client ID and Client Secret Obtained in the previous section (<a href="https://zappysys.com/blog/register-google-oauth-application-get-clientid-clientsecret/" target="_blank" rel="noopener">see here</a>) and then click Generate Token as below.
<div id="attachment_7043" style="width: 1006px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7043" class="size-full wp-image-7043" src="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png" alt="Configure Google API Data Source / DSN (Google Analytics API Example)" width="996" height="870" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth.png 996w, https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth-300x262.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/05/configure-google-analytics-api-driver-data-source-oauth-768x671.png 768w" sizes="(max-width: 996px) 100vw, 996px" /></a><p id="caption-attachment-7043" class="wp-caption-text">Configure Google API Data Source / DSN (Google Analytics API Example)</p></div></li>
<li>Thats it now can click on Preview Tab and run sample query like below.<br />
<pre class="crayon-plain-tag">select * from $</pre>
<strong>&#8211;OR&#8211;</strong><br />
(Select Table name from dropdown and generate default query and then you can add alias , remove unwanted columns)<br />
<pre class="crayon-plain-tag">SELECT 
"ga:date" date, 
"ga:avgSessionDuration" avgSessionDuration,
"ga:newUsers" newUsers
FROM "rows"</pre>
<strong>&#8211;OR&#8211;</strong><br />
(Type custom query with your own URL generated <a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">from here</a>, Change Profile ID &#8211; from 11223344 to your own id)<br />
<pre class="crayon-plain-tag">SELECT * FROM $
WITH(
	 Src='https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date'
	,IncludeParentColumns='False'
)</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-7045" src="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png" alt="" width="652" height="608" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data.png 652w, https://zappysys.com/blog/wp-content/uploads/2019/05/query-google-analytics-data-300x280.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></a></li>
</ol>
<h3>Create Linked Server in SQL Server using T-SQL Script</h3>
<p>Once our Gateway Data Source is configured we can now move to SQL Server Part to define Linked Server.</p>
<p>Here is how you can define linked server to access Google Analytics Data inside SQL Server. There are two ways to create Linked Server (1)  via T-SQL script (2) via SSMS UI)</p>
<p>Here is how to create using Script.</p><pre class="crayon-plain-tag">USE [master]
GO

--drop existing linked server for same name if already found
EXEC master.dbo.sp_dropserver @server=N'GOOGLE_ANALYTICS_LS', @droplogins='droplogins'
GO

EXEC master.dbo.sp_addlinkedserver 
	@server = N'GOOGLE_ANALYTICS_LS', 
	@srvproduct=N'', 
	@provider=N'SQLNCLI', 
	@datasrc=N'localhost,5000', --this is host name and port number where  ZappySys Data Gateway is running
	@catalog=N'ZS-GA' --this must be same name as defined on Data Source tab Grid on ZappySys Data Gateway

EXEC master.dbo.sp_addlinkedsrvlogin 
	@rmtsrvname=N'GOOGLE_ANALYTICS_LS',
	@useself=N'False',
	@locallogin=NULL,
	@rmtuser=N'SOME-GATEWAY-USER', -- user name created on ZappySys Data Gateway
	@rmtpassword='SOME-GATEWAY-PASSWORD' -- password for ZappySys Data Gateway user
GO</pre><p>
&nbsp;</p>
<h3>Create Microsoft SQL Server Linked Server using SSMS UI</h3>
<div class="content_block" id="custom_post_widget-5289">Once you configured data source in Gateway, we can now setup Linked Server in SQL Server to query API data.
<ol style="margin-left: 10px;">
 	<li>Assuming you have installed SQL Server and SSMS. If not then get both for FREE from here: <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express">Get SQL Server Express</a> and  <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener">Get SSMS</a></li>
 	<li>Open SSMS and connect to SQL Server.</li>
 	<li>Go to Root &gt; Server Objects &gt; Linked Servers node. Right click and click <strong>New Linked Server...
</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png" alt="Add Linked Server in SQL Server" />
</a>
<p class="wp-caption-text">Add Linked Server in SQL Server</p>

</div></li>
 	<li> Now enter linked server name, select Provider as SQL Native Client</li>
 	<li>Enter data source as <strong><span class="lang:default decode:true crayon-inline">GatewayServerName,PORT_NUMBER</span></strong> where server name is where ZappySys Gateway is running (Can be same as SQL Server machine or remote machine). Default PORT_NUMBER is 5000 but confirm on Data gateway &gt; General tab incase its different.</li>
 	<li>Enter Catalog Name. This must match name from Data gateway Data sources grid &gt; Name column
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png" alt="Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection" />
</a>
<p class="wp-caption-text">Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection</p>
</div>
<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 15px;margin-bottom: 20px;border: 1px solid transparent;border-radius: 4px;">
<strong>INFO:</strong><br/>
<ul>
    <li>
      For <strong>SQL Server 2012, 2014, 2016, 2017, and 2019</strong>, use the <em>SQL Server Native Client 11.0</em> as the Provider.
    </li>
    <li>
      For <strong>SQL Server 2022 or higher</strong>, use the <em>Microsoft OLE DB Driver for SQL Server</em> as the Provider.
    </li>
  </ul>
</div></li>
 	<li>Click on Security Tab and select last option "<strong>Be made using this security context</strong>". Enter your gateway user account here.</li>
<li>
        <p>Optional: Under the Server Options Tab, Enable <b>RPC</b> and <b>RPC Out</b> and Disable Promotion of Distributed Transactions<b>(MSDTC)</b>.</p>
		<div class="wp-caption alignnone">
			<img decoding="async" class="block margin-bottom-10 img-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/11/linked-server-options-rpc-msdtc.png" title="RPC and MSDTC Settings" alt="RPC and MSDTC Settings" />
			<p class="wp-caption-text">RPC and MSDTC Settings</p>
		</div>
        <hr />
        <p>
            You need to enable RPC Out if you plan to use <b><i>EXEC(...) AT [MY_LINKED_SERVER_NAME]</i></b> rather than OPENQUERY.
            <br />
            If don't enabled it, you will encounter the <i>'Server "MY_LINKED_SERVER_NAME" is not configured for RPC'</i> error.
        </p>
        <p>
            Query Example:
            <code class="sql">EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</code>
        </p>
        <hr />
        <p>
            If you plan to use <b><i>'INSERT INTO...EXEC(....) AT [MY_LINKED_SERVER_NAME]'</i></b> in that case you need to Disable Promotion of Distributed Transactions(MSDTC).
            <br />
            If don't disabled it, you will encounter the <i>'The operation could not be performed because OLE DB provider "SQLNCLI11/MSOLEDBSQL" for linked server "MY_LINKED_SERVER_NAME" was unable to begin a distributed transaction.'</i> error.
        </p>
        <p>
            Query Example:
<pre class="">Insert Into dbo.Products 
EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</pre>
        </p>
        <hr />
</li>
 	<li>Click OK to save Linked Server</li>
 	<li>In SSMS execute below SQL query to test your connectivity.
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 'SELECT * FROM $')</pre>
--OR--
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 
'SELECT * FROM $
 WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json''
 ,Filter=''$.value[*]''
 ,DataFormat=''OData''
)');</pre>
</li>
 	<li>Here is the preview after you run some REST API query in SQL Server. Notice that you can override default configuration by supplying <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-connectionstring.htm" target="_blank" rel="noopener">many parameters</a> in WITH clause (second query example in screenshot).
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png" alt="SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)" />
</a>
<p class="wp-caption-text">SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)</p>

</div></li>
 	<li>You can wrap your queries inside View or wrap inside Stored procedure to parameterize. Here is an example of create view which calls REST API queries. Below View can be consumed like a normal table from any Tools or Programming Language which supports connectivity to SQL Server.
<pre class="lang:tsql decode:true ">CREATE VIEW dbo.vwApiInvoices 
AS 
/*Call REST API inside SQL Server View*/
SELECT * FROM OPENQUERY( LS , 
'SELECT * FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)');

GO
</pre>
&nbsp;</li>
 	<li>Notice in above approach if you parameterize Stored Procedure then <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/" target="_blank" rel="noopener">check this article to understand Dynamic Metadata</a>.</li>
 	<li>That's it. We are now ready to move forward with more interesting things in next section.</li>
</ol></div>
<h3>Import Google Analytics Data into SQL Server Table (T-SQL Code)</h3>
<p>Now lets see how to run sample query to import Google Analytics Data into SQL Server. Notice that how we have escaped quotes in <strong>OPENQUERY</strong>.<br />
<strong>NOTE:</strong> Change id 11223344 with your own Id (<a href="https://ga-dev-tools.appspot.com/query-explorer/" target="_blank" rel="noopener">use this tool</a> to create URL)</p><pre class="crayon-plain-tag">select * into GaApiLoad from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:avgSessionDuration,ga:newUsers&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
 )
')
select * from GaApiLoad</pre><p>
<div id="attachment_7046" style="width: 649px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7046" class="size-full wp-image-7046" src="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png" alt="Import Google Analytics Data into SQL Server Table (using T-SQL Code)" width="639" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server.png 639w, https://zappysys.com/blog/wp-content/uploads/2019/05/import-google-analytics-data-into-sql-server-300x253.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></a><p id="caption-attachment-7046" class="wp-caption-text">Import Google Analytics Data into SQL Server Table (using T-SQL Code)</p></div>
<h2>Expose Google Analytics Data as View</h2>
<p>To make it simple you can expose above query as SQL Server views so you can access them from any Reporting / ETL Tools.</p><pre class="crayon-plain-tag">CREATE VIEW vw_Google_Analytics_BounceRate_PageViews_Last30Days
AS
--change ids to your own Profile ID
select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=2019-04-01&amp;end-date=2019-04-30&amp;metrics=ga:bounceRate,ga:uniquePageviews&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
 )
')
GO</pre><p>
<h2>Making things Dynamic using Stored Procedure with Parameters</h2>
<p>Now let&#8217;s make few things dynamic. We will change above query so we can pass Id, Dimensions and Metrics as parameters.</p>
<p>Run below script to Create a stored proc and fetch google analytics data in SQL Server.</p><pre class="crayon-plain-tag">use MyDatabase
go
create proc usp_GoogleAnalyticsData
	@ids varchar(1000),
	@startDate varchar(50)='30daysAgo',
	@endDate varchar(50)='yesterday',
	@metrics varchar(200)='ga:avgSessionDuration,ga:newUsers',
	@dimensions varchar(200)='ga:date'	
as

declare @sql varchar(4000)

set @sql='select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
''SELECT * FROM "rows"
WITH 
 (
   SRC=''''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:' + @ids 
   +'&amp;start-date='+ @startDate 
   +'&amp;end-date='+ @endDate 
   +'&amp;metrics='+ @metrics 
   +'&amp;dimensions='+ @dimensions 
   +'''''
  ,IncludeParentColumns=''''False''''
 )
'')'

print @sql
execute(@sql)

go

--Example: query google analytics data
exec usp_GoogleAnalyticsData 
	@ids='11223344',  --Change this ID - Obtain from here https://ga-dev-tools.appspot.com/query-explorer/
	@startDate ='30daysAgo',  --or like this 2019-04-01
	@endDate   ='yesterday', --or like this 2019-04-30
	@dimensions='ga:date', 
	@metrics   ='ga:bounceRate,ga:uniquePageviews'</pre><p>
<h3>Insert Google Analytics Data into table (Save Stored Procedure Output)</h3>
<p>Now what if you like to save Stored Proc output into a table? Well for that you must create table with same structure as stored proc output and then use <strong>INSERT INTO</strong> sql like below.</p><pre class="crayon-plain-tag">--import google analytics data in a table
if(object_id('GaDataLoad') is not null)
	drop table GaDataLoad
create table GaDataLoad([Date] date, BounceRate numeric(10,5), PageViews numeric(10,5))  

insert into GaDataLoad
exec usp_GoogleAnalyticsData 
	@ids='11223344',  --Change this ID - Obtain from here https://ga-dev-tools.appspot.com/query-explorer/
	@startDate ='30daysAgo',  --or like this 2019-04-01
	@endDate   ='yesterday', --or like this 2019-04-30
	@dimensions='ga:date', 
	@metrics='ga:bounceRate,ga:uniquePageviews'

select * from GaDataLoad</pre><p>
&nbsp;</p>
<h2>Performance Tips / Handling data errors due to missing rows</h2>
<p>By default ZappySys API Drivers sends minimum 2 API requests. First one to fetch metadata and second, third&#8230; for Data. There will be a time when you wont have any data and it may throw error about no records found because it fails to parse metadata. You can avoid such issue by supplying metadata before hand so you can avoid expensive API calls. <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">Check this article</a> see how you can supply cached metadata in your SQL Query as below. This will avoid Metadata call and speedup significantly. It will also avoid errors due to no rows found for specified criteria.</p><pre class="crayon-plain-tag">select * from OPENQUERY([GOOGLE_ANALYTICS_LS] ,
'SELECT * FROM "rows"
WITH 
 (
   SRC=''https://www.googleapis.com/analytics/v3/data/ga?ids=ga:11223344&amp;start-date=30daysAgo&amp;end-date=yesterday&amp;metrics=ga:bounceRate,ga:uniquePageviews&amp;dimensions=ga:date''
  ,IncludeParentColumns=''False''
  ,Meta=''[ 
     {"Name": "ga:date","Type": "String", "Length": 16 },
     {"Name": "ga:bounceRate", "Type": "String", "Length": 36 },
     {"Name": "ga:uniquePageviews", "Type": "String", "Length": 10 }
    ]''
 )
')</pre><p>
&nbsp;</p>
<h2>ODBC Connection &#8211; Google Analytics Data in Other Apps (e.g. SSRS / Power BI / Excel / Tableau)</h2>
<p>So far we have talked accessing data inside SQL Server using Data Gateway Approach but what if you like to access in other apps ? Well you have three options.</p>
<ol>
<li>Use Microsoft SQL Server Driver to call Linked Server Queries (OPENQUERY approach we saw earlier)</li>
<li>Access Google Analytics Data using ODBC connectivity</li>
<li>Use Microsoft SQL Server Driver to send direct SQL queries to Gateway (Bypass Linked Server &#8211; Use inner SQL query without OPENQUERY in this case)</li>
</ol>
<h3><strong>Method-1 : Linked Server Approach</strong></h3>
<p>First approach most likely works in all cases because most apps will support connecting to SQL Server using OLEDB / ADO.net / ODBC / JDBC Drivers. So calling SQL Queries which uses Linked Server (i.e. OPENQUERY statement)  is advisable.</p>
<h3><strong>Method-2 : ODBC Driver Approach</strong></h3>
<p>However in some cases this may not be possible (e.g. You don&#8217;t have SQL Server inhouse or you don&#8217;t want to rely on SQL Server to access API). In such case you can use ODBC connectivity in your app. Since ODBC is widely adopted standard most app out there (Except JAVA apps) should support ODBC Drivers. If you like to use this approach then create ODBC DSN rather than Data Gateway Data source and use it in your Reporting / ETL / Custom Apps.</p>
<p>&nbsp;</p>
<div id="attachment_6213" style="width: 404px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6213" class="wp-image-6213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png" alt="Open ODBC Data Sources (Create DSN)" width="394" height="542" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2.png 394w, https://zappysys.com/blog/wp-content/uploads/2019/01/how-to-open-odbc-data-source-administrator-2-218x300.png 218w" sizes="(max-width: 394px) 100vw, 394px" /></a><p id="caption-attachment-6213" class="wp-caption-text">Open ODBC Data Sources (Create DSN)</p></div>
<div id="attachment_3993" style="width: 1067px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3993" class="size-full wp-image-3993" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png" alt="ODBC User DSN Tab: Add new Driver Screen" width="1057" height="422" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver.png 1057w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-300x120.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-768x307.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-user-dsn-select-driver-1024x409.png 1024w" sizes="(max-width: 1057px) 100vw, 1057px" /></a><p id="caption-attachment-3993" class="wp-caption-text">ODBC User DSN Tab: Add new Driver Screen</p></div>
<p>&nbsp;</p>
<h3><strong>Method-3 : Direct connection to Data Gateway (By pass Linked Server)</strong></h3>
<p>Last option we suggest for cases like JAVA Apps / Linux / Mac machines where you cannot install ZappySys ODBC Drivers and you dont have option to use SQL Server Linked Server either. In such case you can try to send SQL Queries to Gateway directly using Microsoft SQL Server Compatible Drivers (i.e. ODBC /JDBC). <a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">See this example</a> how we called API Queries inside JAVA Apps.</p>
<h3>Google Analytics / REST API Integration in various apps</h3>
<div class="content_block" id="custom_post_widget-7051">ZappySys ODBC Drivers built using ODBC standard which is widely adopted by industry for a long time. Which mean the majority of BI Tools / Database Engines / ETL Tools already there will support native / 3rd party ODBC Drivers. Below is the small list of most popular tools / programming languages our Drivers support. If your tool / programming language doesn't appear in the below list, which means we have not documented use case but as long as your tool supports ODBC Standard, our drivers should work fine.

&nbsp;

<img loading="lazy" decoding="async" class="" src="//zappysys.com/images/odbc-powerpack/odbc-powerpack-integration.jpg" alt="ZappySys ODBC Drivers for REST API, JSON, XML - Integrate with Power BI, Tableau, QlikView, QlikSense, Informatica PowerCenter, Excel, SQL Server, SSIS, SSAS, SSRS, Visual Studio / WinForm / WCF, Python, C#, VB.net, PHP. PowerShell " width="750" height="372" />
<table style="valign: top;">
<tbody>
<tr>
<td>
<p style="text-align: center;"><strong>BI / Reporting Tools
Integration</strong></p>
</td>
<td style="text-align: center;"><strong>ETL Tools
Integration
</strong></td>
<td style="text-align: center;"><strong>Programming Languages</strong>
<strong>Integration</strong></td>
</tr>
<tr>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">Microsoft Power BI</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Tableau</a></li>
 	<li><a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">SSRS (SQL Reporting Services)</a></li>
 	<li><a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">QlikView /Qlik Sense</a></li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-in-microstrategy-json-soap-xml/" target="_blank" rel="noopener">MicroStrategy</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-google-sheet-call-appscript-load-json-soap-xml-csv/" target="_blank" rel="noopener">Google Sheet</a></li>
 	<li><a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">Microsoft Excel</a></li>
 	<li><a href="https://zappysys.com/api/integration-hub/rest-api-connector/access?context=connector" target="_blank" rel="noopener">Microsoft Access</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica PowerCenter</a> (Windows)</li>
 	<li>Informatica Cloud</li>
 	<li>SSIS (SQL Integration Services)</li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">SQL Server</a></li>
 	<li><a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/" target="_blank" rel="noopener">Talend Data Studio</a></li>
 	<li><a href="https://zappysys.com/blog/pentaho-read-rest-api-in-pentaho/" target="_blank" rel="noopener">Pentaho Kettle</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li>Visual Studio</li>
 	<li><a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a></li>
 	<li>C++</li>
 	<li><a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a></li>
 	<li><a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a></li>
 	<li>PHP</li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-powershell-script-export-json-csv/" target="_blank" rel="noopener">PowerShell</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">T-SQL (Using Linked Server)</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
&nbsp;</div>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>In this article we explored many ideas of JSON / API integration in SQL Server.  We saw how to create OAuth App for Google API and import Google Analytics data into SQL Server Table without doing any ETL using pure T-SQL code (Query / Views /Stored Procs). You can <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">Download  FREE Trial of ODBC PowerPack</a> and try yourself see how easy it is to query any API inside SQL Server and avoid expensive ETL processes.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/import-google-analytics-data-sql-server-reporting-etl/">Import Google Analytics data into SQL Server / Reporting / ETL</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to get data from Google AdWords using SSIS</title>
		<link>https://zappysys.com/blog/get-data-from-google-adwords-using-ssis/</link>
					<comments>https://zappysys.com/blog/get-data-from-google-adwords-using-ssis/#comments</comments>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 13 Jun 2016 16:32:55 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[AdWords]]></category>
		<category><![CDATA[API Integration]]></category>
		<category><![CDATA[DFP]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[Google DoubleClick]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml source]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=564</guid>

					<description><![CDATA[<p>Introduction Google AdWords is one of the most popular Advertise Platforms. In this article, you will learn how to get data from Google AdWords by calling Google AdWords Web Service method and using drag and drop SSIS XML/SOAP connector (No coding required :)). Google AdWords Web Services allows retrieving various data such as account info, campaigns; [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-data-from-google-adwords-using-ssis/">How to get data from Google AdWords using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/google-ads-connector/">API Connector for Google AdWords</a> which makes it much simpler to <strong>Read/Write Google AdWords Data in SSIS/ODBC</strong> compared to the steps listed in this article. You can still use steps from this article but if you are new to API or want to avoid learning curve with API then use newer approach.</p>
<p>Please visit <a href="https://zappysys.com/api/integration-hub/">this page to see all</a> Pre-Configured ready to use API connectors which you can use in <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source</a> / <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-destination/">SSIS API Destination</a> OR <a href="https://zappysys.com/products/odbc-powerpack/odbc-api-driver/">API ODBC Driver</a> (for non-SSIS Apps such as Excel, Power BI, Informatica).<br />
</div></div>
<p style="text-align: justify;"><strong><a href="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-integration.png"><img loading="lazy" decoding="async" class=" wp-image-1663 alignleft" src="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-integration.png" alt="" width="128" height="128" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-integration.png 273w, https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-integration-150x150.png 150w" sizes="(max-width: 128px) 100vw, 128px" /></a>Google AdWords</strong> is one of the most popular Advertise Platforms. In this article, you will learn <em>how to get data from Google AdWords</em> by calling Google AdWords Web Service method and using drag and drop <strong><a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">SSIS XML/SOAP connector</a></strong> (No coding required :)). Google AdWords Web Services allows retrieving various data such as account info, campaigns; as well as writing data, such as creating a campaign, add a keyword. Basically, it allows controlling your AdWords account programmatically instead of using the AdWords dashboard. For demo purposes, we will <strong>get data from Google AdWords</strong> Account and <strong>load it into Microsoft SQL Server </strong>(but you can use this technique to save any supported targets in SSIS (e.g. Excel, FlatFile, Oracle, MySQL, IBM DB2, etc.).</p>
<p>If you desire to download a report from AdWords, you must follow a different approach described in an <a href="https://zappysys.com/blog/download-adwords-report-using-google-api-odbc-xml-driver/">article on how to download AdWords report</a>. It describes how to download a report using ODBC and XML Driver but the concepts introduced there can be applied to SSIS as well.</p>
<p>If you are looking for a similar article for <strong>Google DoubleClick for Publisher</strong> (Google DFP) then <a href="//zappysys.com/blog/calling-google-dfp-api-with-ssis-doubleclick-soap-api/" target="_blank" rel="noopener">check this article</a>.</p>
<p>You will also learn <strong>how to create Google Ads</strong> or modify any other objects by calling SOAP API using <u><span style="color: #000080;">SSIS REST API Task</span></u>.</p>
<h2>SSIS Tasks/Connectors discussed in this Article</h2>
<p>In this article we will use following Connector(s) and Connection Manager to archive full data integration with Google AdWords.</p>
<p>Following SSIS Connectors support <strong>OAuth Connectivity</strong>. When you use below connectors no coding required to pull data from any OAuth enabled services (e.g. Twitter, Facebook, LinkedIn).</p>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr>
<td width="36"><span style="color: #248cc8"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png" alt="Custom SSIS Tasks - Call REST API Webservice (GET, POST, DELETE etc)" width="32" /></span></td>
<td><u><span style="color: #248cc8"><a href="//zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a></span></u></td>
</tr>
<tr>
<td width="36"><span style="color: #248cc8"><img decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/oauth-connection/ssis-oauth-connection-manager.png" alt="SSIS OAuth Connection Manager" width="32" /></span></td>
<td><a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener"><span style="color: #248cc8">OAuth Connection Manager</span></a></td>
</tr>
<tr>
<td width="36"><span style="color: #248cc8"><img decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-xml-source.png" alt="Custom SSIS Components - XML Source (File, REST, SOAP)" width="32" /></span></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener"><span style="color: #248cc8">XML Source (REST API, SOAP Call or File data)</span></a></td>
</tr>
</tbody>
</table>
</div>
<h2>Two different ways to get Google AdWords Data in SSIS</h2>
<p>There are two ways you can extract Google AdWords data in SSIS.</p>
<ol>
<li>Use <a href="//zappysys.com/products/ssis-powerpack/ssis-google-analytics-source-connector/" target="_blank" rel="noopener">Google Analytics Source</a> (For more info <a href="//zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/" target="_blank" rel="noopener">see this article</a>)  (Consume AdWords data using Google Analytics REST API)</li>
<li>Use XML Source along with OAuth connection manager (Consume AdWords data using SOAP API)</li>
</ol>
<p>In this article we will only discuss Approach #2. For approach #1 refer <a href="//zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/#How_to_read_google_Adwords_Data_using_Google_Analytics_Source" target="_blank" rel="noopener">see this link</a></p>
<p>Advantage of #2 is you get total control of full API set for AdWords but you have to do lot more manual work. For Approach #1 is lot simpler but you get access to limited reports (Dimensions and Metrics).</p>
<h2>Google AdWords API Integration Example Screenshot</h2>
<p>Below is screenshot of sample package discussed in this article (<a href="//zappysys.com/blog/wp-content/uploads/2016/06/OAuthGoogleAdWords_2012.zip" target="_blank" rel="noopener">Download from here</a>). As you can see we tried to demonstrate Reading data and Managing data (e.g. Create Ad) in the same package. You can extend these technique to perform any type of operations in <strong>Google AdWords</strong> or similar service such as <strong>DoubleClick for Publisher</strong></p>
<div id="attachment_573" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/ssis-package-extract-google-adwords-data-soap-api-create-ad-get-campaigns.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-573" class="wp-image-573" src="//zappysys.com/blog/wp-content/uploads/2016/06/ssis-package-extract-google-adwords-data-soap-api-create-ad-get-campaigns.png" alt="Google AdWords API Integration Example - Create Ad, Get Accounts, Get Campaigns, Get Ad Groups, Get Ads (Extract AdWords data via SOAP API) , Read data using Selector Method or use AWQL query language" width="600" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/ssis-package-extract-google-adwords-data-soap-api-create-ad-get-campaigns.png 732w, https://zappysys.com/blog/wp-content/uploads/2016/06/ssis-package-extract-google-adwords-data-soap-api-create-ad-get-campaigns-300x195.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-573" class="wp-caption-text">Google AdWords API Integration Example &#8211; Create Ad, Get Accounts, Get Campaigns, Get Ad Groups, Get Ads (Extract AdWords data via SOAP API, Read data using Selector Method or use AWQL query language)</p></div>
<h2>Step-By-Step Tutorial</h2>
<p>Here are few high level steps you will have to perform to extract data from <strong>Google AdWords API</strong> using SSIS. This section assumes you have ClientID and Developer Token to access data. if you don&#8217;t have that then read next 2-3 sections.</p>
<ol>
<li>Download and install <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here</a></li>
<li>Create new SSIS Project</li>
<li>From SSIS toolbox drag DataFlow Task and go to dataflow designer</li>
<li>From toolbox of drag <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-source/">ZS XML Source</a></li>
<li>Double click <strong>XML Source</strong> to configure it</li>
<li>Specify API URL from which you want to read data<br />
Example : <span style="text-decoration: underline;">https://adwords.google.com/api/adwords/mcm/<strong>v201509</strong>/ManagedCustomerService</span></li>
<li>Now check Use Credentials check box and select New <strong>ZS-OAuth</strong> connection manager.</li>
<li>On connection manager UI you can select <strong>Google</strong> from Provider Dropdown.</li>
<li>Under Scopes enter following (Scope is basically permission)<br />
<pre class="crayon-plain-tag">https://www.googleapis.com/auth/adwords</pre>
&nbsp;</li>
<li>Now click <strong>Generate Token</strong> and when prompted login and in the last step Accept.</li>
<li>If everything went ok then you will see <strong>AccessToken</strong> and <strong>RefreshToken</strong> populated.</li>
<li>Click <strong>Test connection</strong> and close the UI by clicking OK</li>
<li>Now on XML Source &#8211; Select HTTP Request Method as <strong>POST</strong></li>
<li>In the Request Body click edit and enter request as below (Replace DEV_TOKEN and CLIENT_ID placeholders below)<br />
<pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
	&lt;soap:Header&gt;
		&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201605"&gt;
			&lt;developerToken&gt;ENTER_YOUR_DEV_TOKEN_HERE&lt;/developerToken&gt;
			&lt;clientCustomerId&gt;ENTER_YOUR_CLIENT_ID_HERE&lt;/clientCustomerId&gt;
			&lt;userAgent&gt;ZappySys SSIS PowerPack v1&lt;/userAgent&gt;
		&lt;/RequestHeader&gt;
	&lt;/soap:Header&gt;
	&lt;soap:Body&gt;
		&lt;get xmlns="https://adwords.google.com/api/adwords/mcm/{{User::ApiVersion}}"&gt;
			&lt;serviceSelector&gt;
				&lt;fields&gt;CustomerId&lt;/fields&gt;
				&lt;fields&gt;Name&lt;/fields&gt;
			&lt;/serviceSelector&gt;
		&lt;/get&gt;
	&lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre>
&nbsp;</p>
<div class="su-note"  style="border-color:#e5e5c6;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#ffffe0;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">
<p>If you are wondering how did we get above XML fragment for Request Body then <a href="//zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article on how to use SoapUI (free 3rd party tool) to create SOAP request Bodyfrom WSDL</a>. Google AdWords has many API endpoints for different service. For each service you have different Api URL and different WSDL. In the next section you can learn how to create correct SOAP Body (for POST) using <strong>SoapUI</strong> tool.</p>
<p>For example if you are calling ManagedCustomerService API for version <strong>v201609</strong> then your <strong>help page URL would be like this</strong><br />
<a href="https://developers.google.com/adwords/api/docs/reference/v201609/ManagedCustomerService" target="_blank" rel="noopener">https://developers.google.com/adwords/api/docs/reference/v201609/ManagedCustomerService</a></p>
<p>And on the same page you will see <strong>WSDL link below</strong><br />
<a href="https://ads.google.com/apis/ads/publisher/v201702/NetworkService?wsdl" target="_blank" rel="noopener">https://ads.google.com/apis/ads/publisher/v201702/NetworkService?wsdl</a><br />
(Just download that WSDL XML and save to local disk then use with SoapUI to generate XML body to submit for any DFP API call.)</p>
<p><a href="//zappysys.com/blog/calling-google-dfp-api-with-ssis-doubleclick-soap-api/#How_to_generate_SOAP_Request_Body_using_SoapUI_tool" target="_blank" rel="noopener">See this link for more information</a> (Its for Google DoubleClick Ad Platform but you will get an idea)</p>
</div></div></li>
<li>Go to Array handling tab at the bottom and enter text : <strong>ns2:entries</strong> &#8211; By doing this we will treat <strong>&lt;ns2:entries&gt;</strong> node as array eventhough only one entry found in response (By default content with multiple records treated as array).
<div id="attachment_571" style="width: 430px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/soap-xml-response-array-handling-adwords-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-571" class="size-full wp-image-571" src="//zappysys.com/blog/wp-content/uploads/2016/06/soap-xml-response-array-handling-adwords-api.png" alt="Handling Array Element Nodes in SOAP Response" width="420" height="134" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/soap-xml-response-array-handling-adwords-api.png 420w, https://zappysys.com/blog/wp-content/uploads/2016/06/soap-xml-response-array-handling-adwords-api-300x96.png 300w" sizes="(max-width: 420px) 100vw, 420px" /></a><p id="caption-attachment-571" class="wp-caption-text">Handling Array Element Nodes in SOAP Response</p></div></li>
<li>On the filter expression click edit and highlight entries node and click ok. This will produce something like below in filter textbox<br />
<pre class="crayon-plain-tag">$.soap:Envelope.soap:Body.ns2:getResponse.ns2:rval.ns2:entries[*]</pre>
&nbsp;</li>
<li>Now click preview to see actual data.</li>
<li>Click OK to save UI. Now you can connect source to target such as SQL Server or <a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a>.</li>
</ol>
<blockquote><p>NOTE: in above example we used v201605 API version but change it to latest if this API is no more valid. Google expires API version pretty often so keep that in mind if you get depreciated API version error.</p></blockquote>
<h2>Register for Developer Token to access AdWords account data using API</h2>
<p>First important step to access any Google AdWords Account is request developer token. <a href="https://developers.google.com/adwords/api/docs/guides/first-api-call" target="_blank" rel="noopener">Click this link</a> for step by step information. Watch short vide to get overview on entire process to access data via API.</p>
<h2>Find your Client ID</h2>
<p>Next thing you will need to know is your ClientID. Most of API Requests will require your ClientID. Perform following steps to find your ClientID.</p>
<p>Login to your AdWords Account using email address. At the top you will see your client ID as below screenshot.</p>
<div id="attachment_567" style="width: 610px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-account-client-id-for-soap-api-calls.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-567" class="wp-image-567" src="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-account-client-id-for-soap-api-calls.png" alt="How to find ClientID of your Google AdWords Account (Useful for making SOAP API Calls)" width="600" height="174" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-account-client-id-for-soap-api-calls.png 920w, https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-account-client-id-for-soap-api-calls-300x87.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-567" class="wp-caption-text">How to find ClientID of your Google AdWords Account (Useful for making SOAP API Calls)</p></div>
<p>&nbsp;</p>
<h2>Connect to Google AdWords API using OAuth</h2>
<p>Connecting to any Google API will require OAuth 2.0. SSIS PowerPack has Protocol so you can easily extract data from API without coding complex token extract/renew workflow. Such things usually requires some sort of programming but in our case you will do few clicks as described in Step-By-Step section earlier.</p>
<p>Here is the screenshot of OAuth Connection Manager.</p>
<div id="attachment_575" style="width: 660px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/calling-google-adwords-api-using-oauth-in-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-575" class="wp-image-575" src="//zappysys.com/blog/wp-content/uploads/2016/06/calling-google-adwords-api-using-oauth-in-ssis.png" alt="Connecting to Google AdWords API using OAuth 2.0 in SSIS (Consuming XML/SOAP API)" width="650" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/calling-google-adwords-api-using-oauth-in-ssis.png 932w, https://zappysys.com/blog/wp-content/uploads/2016/06/calling-google-adwords-api-using-oauth-in-ssis-300x186.png 300w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-575" class="wp-caption-text">Connecting to Google AdWords API using OAuth 2.0 in SSIS (Consuming XML/SOAP API)</p></div>
<p>&nbsp;</p>
<h2>Extract data from Google AdWords using SOAP API Calls</h2>
<p>When you define filter expression you can check/uncheck &#8220;Include Parent Columns&#8221; setting. For AdWords SOAP Api you can uncheck so you only extract columns from rvals node in XML Response.</p>
<div id="attachment_576" style="width: 560px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-select-xml-path-soap-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-576" class="wp-image-576" src="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-select-xml-path-soap-request.png" alt="Extract data from Google AdWords SOAP/XML Response" width="550" height="444" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-select-xml-path-soap-request.png 686w, https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-api-select-xml-path-soap-request-300x242.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></a><p id="caption-attachment-576" class="wp-caption-text">Extract data from Google AdWords SOAP/XML Response</p></div>
<p>&nbsp;</p>
<h2>SOAP Response Paging / Looping</h2>
<p>Many time you will get response which is larger than default page size in AdWords API Call. In that case you can specify few pagination attributes on XML Source Paging tab. For more information on paging options you may refer <a href="//zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">this article</a> . This article is talking about JSON Source but same options are applicable for XML Source too.</p>
<div id="attachment_626" style="width: 513px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/04/ssis-xml-soap-api-pagination-google-adwords-pass-page-number.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-626" class="size-full wp-image-626" src="//zappysys.com/blog/wp-content/uploads/2016/04/ssis-xml-soap-api-pagination-google-adwords-pass-page-number.png" alt="REST API Pagination - Passing PageNumber inside POST Body (Example: Google AdWords SOAP Api)" width="503" height="547" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-xml-soap-api-pagination-google-adwords-pass-page-number.png 503w, https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-xml-soap-api-pagination-google-adwords-pass-page-number-276x300.png 276w" sizes="(max-width: 503px) 100vw, 503px" /></a><p id="caption-attachment-626" class="wp-caption-text">REST API Pagination &#8211; Passing PageNumber inside POST Body (Example: Google AdWords SOAP Api)</p></div>
<p>&nbsp;</p>
<div id="attachment_625" style="width: 665px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/04/ssis-rest-api-pagination-pass-page-number-inside-request-body-post-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-625" class="size-full wp-image-625" src="//zappysys.com/blog/wp-content/uploads/2016/04/ssis-rest-api-pagination-pass-page-number-inside-request-body-post-data.png" alt="Configure REST API Pagination - using Page Number via POST Body Method" width="655" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-rest-api-pagination-pass-page-number-inside-request-body-post-data.png 655w, https://zappysys.com/blog/wp-content/uploads/2016/04/ssis-rest-api-pagination-pass-page-number-inside-request-body-post-data-300x205.png 300w" sizes="(max-width: 655px) 100vw, 655px" /></a><p id="caption-attachment-625" class="wp-caption-text">Configure REST API Pagination &#8211; using Page Number via POST Body Method</p></div>
<h2>Read Google AdWords data and Load into SQL Server</h2>
<p>Using XML Source you can extract data in tabular format and then you can map that to SQL Server Target (Use OLEDB Destination / ADO.net Destination).</p>
<div id="attachment_579" style="width: 719px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/extract-data-from-google-adwords-load-into-sql-server-using-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-579" class="size-full wp-image-579" src="//zappysys.com/blog/wp-content/uploads/2016/06/extract-data-from-google-adwords-load-into-sql-server-using-ssis.png" alt="Extract data from Google AdWords and load into SQL Server table using SSIS" width="709" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/extract-data-from-google-adwords-load-into-sql-server-using-ssis.png 709w, https://zappysys.com/blog/wp-content/uploads/2016/06/extract-data-from-google-adwords-load-into-sql-server-using-ssis-300x171.png 300w" sizes="(max-width: 709px) 100vw, 709px" /></a><p id="caption-attachment-579" class="wp-caption-text">Extract data from Google AdWords and load into SQL Server table using SSIS</p></div>
<h2>Write data / Manage AdWords Account via REST API Calls</h2>
<p>So far we have seen how to read data from AdWords account. But what if you have to create new records or write/update AdWords data via API Calls in automated manner? No worry &#8211; If you have need for that then use <a href="//zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">SSIS REST API Task</a> which supports adhoc HTTP WebRequests including POST/DELETE/PUT etc. You can also upload files via REST API call using this task. This task supports rich error handling and saving your response into variable or files.</p>
<h3>Create Ad under specific AdGroup</h3>
<p>Below example shows how to create new ad under specific AdGroup using <u><span style="color: #000080;">REST API Task</span></u></p>
<p>Notice we have used few placeholders to make things dynamic using SSIS Variables. Once REST API Task is executed you will see new ad created.</p>
<div id="attachment_577" style="width: 590px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-create-new-ad-using-soap-xml-api-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-577" class="wp-image-577" src="//zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-create-new-ad-using-soap-xml-api-ssis.png" alt="Creating Google AdWords Ad using SOAP/XML API in SSIS (REST API Task)" width="580" height="464" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-create-new-ad-using-soap-xml-api-ssis.png 703w, https://zappysys.com/blog/wp-content/uploads/2016/06/google-adwords-create-new-ad-using-soap-xml-api-ssis-300x240.png 300w" sizes="(max-width: 580px) 100vw, 580px" /></a><p id="caption-attachment-577" class="wp-caption-text">Creating Google AdWords Ad using SOAP/XML API in SSIS (REST API Task)</p></div>
<div id="attachment_578" style="width: 660px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/06/create-new-google-adwords-ad-via-soap-api-in-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-578" class="wp-image-578" src="//zappysys.com/blog/wp-content/uploads/2016/06/create-new-google-adwords-ad-via-soap-api-in-ssis.png" alt="Verify Google Ad created programmatically using SOAP/XML API Call (SSIS REST API Task)" width="650" height="353" srcset="https://zappysys.com/blog/wp-content/uploads/2016/06/create-new-google-adwords-ad-via-soap-api-in-ssis.png 916w, https://zappysys.com/blog/wp-content/uploads/2016/06/create-new-google-adwords-ad-via-soap-api-in-ssis-300x163.png 300w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-578" class="wp-caption-text">Verify Google Ad created programmatically using SOAP/XML API Call (SSIS REST API Task)</p></div>
<h2>Methods for Creating new records</h2>
<p>Google AdWords API supports <strong>mutate</strong> method for writing data. Many service endpoints supports this method. Below example request will create new Ad.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
	&lt;soap:Header&gt;
		&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;
			&lt;developerToken&gt;{{User::varDevToken}}&lt;/developerToken&gt;
			&lt;clientCustomerId&gt;{{User::varClientId}}&lt;/clientCustomerId&gt;
			&lt;userAgent&gt;My Test AdWords App (AwApi-DotNet/18.20.0, Common-Dotnet/3.11.0, .NET CLR/4.0.30319.18444, gzip)&lt;/userAgent&gt;
		&lt;/RequestHeader&gt;
	&lt;/soap:Header&gt;
	&lt;soap:Body&gt;
		&lt;mutate xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;
			&lt;operations&gt;
				&lt;operator&gt;ADD&lt;/operator&gt;
				&lt;operand&gt;
	                &lt;adGroupId&gt;30800928123&lt;/adGroupId&gt;
	                &lt;ad xsi:type="TextAd"&gt;
	                    &lt;displayUrl&gt;//zappysys.com/ad1&lt;/displayUrl&gt;
	                    &lt;finalUrls&gt;//zappysys.com/ad1&lt;/finalUrls&gt;
	                    &lt;headline&gt;This is my Ad&lt;/headline&gt;
	                    &lt;description1&gt;This is Line 1&lt;/description1&gt;
	                    &lt;description2&gt;This is Line 2&lt;/description2&gt;
	                &lt;/ad&gt;            
				&lt;/operand&gt;
			&lt;/operations&gt;
		&lt;/mutate&gt;
	&lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre><p>
<h2>Methods for Reading AdWords data</h2>
<p>Google AdWords API supports two methods for reading data. Most of AdWords service endpoints supports GET method also known as Selector method (Its basically sending query in XML format). Seconds method is Query Method. It uses SQL like query language known as <a href="https://developers.google.com/adwords/api/docs/guides/awql" target="_blank" rel="noopener">AWQL</a>. (Read more about <a href="https://developers.google.com/adwords/api/docs/guides/awql" target="_blank" rel="noopener">AWQL query language</a>). If you are SQL Programmer then you may like AWQL Query method better than Selector. But either way you will be able to pass following information.</p>
<ul>
<li>Columns you want to return</li>
<li>Filter (e.g. Where Clause)</li>
<li>Order By</li>
<li>Paging information (e.g. PageNumber, PageSize)</li>
</ul>
<h3>Get Method (XML Selector)</h3>
<p>For Get Method using XML tags to define columns, filters and order by/paging information. Here is example Get method for below select query</p><pre class="crayon-plain-tag">SELECT Id, Heading
WHERE Status = 'ENABLED'
ORDER BY Heading DESC 
LIMIT 0,50</pre><p>
<strong>Get Request (Get all Active Ads)</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
	&lt;soap:Header&gt;
		&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;
			&lt;developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;{{User::varDevToken}}&lt;/developerToken&gt;
			&lt;clientCustomerId xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;{{User::varClientId}}&lt;/clientCustomerId&gt;
			&lt;userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;My Test AdWords App (AwApi-DotNet/18.20.0, Common-Dotnet/3.11.0, .NET CLR/4.0.30319.18444, gzip)&lt;/userAgent&gt;
		&lt;/RequestHeader&gt;
	&lt;/soap:Header&gt;
	&lt;soap:Body&gt;
		&lt;get xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;
			&lt;serviceSelector&gt;
			    &lt;fields&gt;Id&lt;/fields&gt;
			    &lt;fields&gt;Headline&lt;/fields&gt;
			    &lt;predicates&gt;
			        &lt;field&gt;Status&lt;/field&gt;
			        &lt;operator&gt;EQUALS&lt;/operator&gt;
			        &lt;values&gt;ENABLED&lt;/values&gt;
			    &lt;/predicates&gt;
			    &lt;ordering&gt;
			        &lt;field&gt;Headline&lt;/field&gt;
			        &lt;sortOrder&gt;ASCENDING&lt;/sortOrder&gt;
			    &lt;/ordering&gt;
			    &lt;paging&gt;
			        &lt;startIndex&gt;0&lt;/startIndex&gt;
			        &lt;numberResults&gt;50&lt;/numberResults&gt;
			    &lt;/paging&gt;
			&lt;/serviceSelector&gt;
		&lt;/get&gt;
	&lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre><p>
<h3>Query Method (AWQL Query &#8211; SQL like query language)</h3>
<p>Below is sample Soap request for AWQL Method to read Ads listed under from specific AdGroups. To learn more AWQL Query Syntax <a href="https://developers.google.com/adwords/api/docs/guides/awql" target="_blank" rel="noopener">Click Here</a>.</p>
<p>To learn more about which Columns you can use inside your AWQL Query <a href="https://developers.google.com/adwords/api/docs/appendix/selectorfields#v201605-AdGroupAdService" target="_blank" rel="noopener">Click here.</a> Note that each service support different fields for Select Clause, Where Clause and Order By Clause. AWQL language can be also used to query Predefined AdWords Reports. The only difference is .. FROM clause is required when you query Reports.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
	&lt;soap:Header&gt;
		&lt;RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;
			&lt;developerToken xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;YOUR_DEV_TOKEN&lt;/developerToken&gt;
			&lt;clientCustomerId xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;YOUR_CLIENT_ID&lt;/clientCustomerId&gt;
			&lt;userAgent xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;My Test AdWords App (AwApi-DotNet/18.20.0, Common-Dotnet/3.11.0, .NET CLR/4.0.30319.18444, gzip)&lt;/userAgent&gt;
		&lt;/RequestHeader&gt;
	&lt;/soap:Header&gt;
	&lt;soap:Body&gt;
		&lt;query xmlns="https://adwords.google.com/api/adwords/cm/v201605"&gt;
			&lt;query&gt;
SELECT Id, Name
WHERE Status = 'ENABLED'
LIMIT 0,5
			&lt;/query&gt;
		&lt;/query&gt;
	&lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre><p>
&nbsp;</p>
<h2>Call AdWords Reports API &#8211; Download Campaign Performance data</h2>
<p>There will be a time you like to <a href="https://developers.google.com/adwords/api/docs/guides/reporting#http_request_url" target="_blank" rel="noopener">download Reports from Adwords</a>. For that  <a href="https://zappysys.com/blog/download-adwords-report-using-google-api-odbc-xml-driver/" target="_blank" rel="noopener">read this article</a>. Its showing how to use ZappySys ODBC Driver to call AdWords Reporting API but concept is same in SSIS Product too due to similar UI elements.</p>
<h2>Download Example SSIS Package</h2>
<p><a href="//zappysys.com/blog/wp-content/uploads/2016/06/OAuthGoogleAdWords_2012.zip">Download SSIS 2012 / 2014/ 2016 Sample</a></p>
<h2>Conclusion</h2>
<p><em>Google AdWords data integration</em> can be very challenging without right set of tools. <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a> certainly makes it easy when you have to extract/manage Google AdWords data. Innovative drag and drop approach gives you various options to cover simple or most advanced scenarios without relying on any Programming language (e.g. C#, Java, Python, Ruby etc).</p>
<p>The post <a href="https://zappysys.com/blog/get-data-from-google-adwords-using-ssis/">How to get data from Google AdWords using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://zappysys.com/blog/get-data-from-google-adwords-using-ssis/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Get data from Google Analytics in SSIS using REST API Call</title>
		<link>https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 08 Jan 2016 14:54:01 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[SSIS Google Analytics Source]]></category>
		<category><![CDATA[AdWords]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=294</guid>

					<description><![CDATA[<p>Introduction Google Analytics is the most popular web analytics service that tracks and reports website traffic. In this blog post you will learn how to get data from Google Analytics using SSIS using SSIS Google Analytics Source Connector (Using drag and drop approach without Coding). This article assumes you have basic knowledge about SSIS and [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/">Get data from Google Analytics in SSIS using REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Google Analytics is the most popular web analytics service that tracks and reports website traffic. In this blog post you will learn how to <em>get data from Google Analytics using SSIS using <a href="//zappysys.com/products/ssis-powerpack/ssis-google-analytics-source-connector/">SSIS Google Analytics Source Connector</a> (Using drag and drop approach without Coding).</em> This article assumes you have basic knowledge about SSIS and you have necessary tools installed &#8211; <a href="http://binaryworld.net/blogs/how-to-install-ssis-2012-2014-2016-ssdt-bi-visual-studio/" target="_blank" rel="noopener">Check this if not</a>)</p>
<p>For demo purpose we will <em>load data from Google Analytics into SQL Server Database</em> but you can use same techniques to load data into Oracle, MySQL, Excel or any other RDBMS.</p>
<h2>Prerequisite</h2>
<p>This article assumes you have installed following tools</p>
<ol>
<li>Install Client Tools for SSIS (atleast one version from below list) &#8211; <a href="http://binaryworld.net/blogs/how-to-install-ssis-2012-2014-2016-ssdt-bi-visual-studio/" target="_blank" rel="noopener">Check this for detail</a>
<ol>
<li>BIDS for SSIS 2008 (i.e. SQL Server 2008 or 2008 R2) &#8212; OR &#8212;</li>
<li>SSDT BI for Visual Studio 2012 (i.e. for SQL Server 2012) &#8212; OR &#8212;</li>
<li>SSDT BI for Visual Studio 2013 (i.e. for SQL Server 2014) &#8212; OR &#8212;</li>
<li>SSDT BI for Visual Studio 2015 (i.e. for SQL Server 2012/2014 or 2016)</li>
</ol>
</li>
<li>Install SSIS PowerPack (<a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">Click here to download</a>) it will add new Connector in SSIS Toolbox to access Google Analytics Connector.</li>
<li>You have setup correct permission for user to access google analytics data (See below section or <a href="//zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/#Setup_Google_analytics_data_permission_for_other_users" target="_blank" rel="noopener">read here</a>)</li>
</ol>
<h2>Video Tutorial &#8211; Get data from Google Web Analytics Platform</h2>
<a href="https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2Fgr_s9kdvrKw%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>What is Google Analytics Connector for SSIS?</h2>
<p>The<em> SSIS Google Analytics Source</em> connector can be used to read data from your Google Analytics Service without learning complex APIs or coding/scripting in Python, Java, C#, etc. It has an easy to use drag and drop interface which allows you to extract large amounts of data, adjusting parameters such as dimensions, metrics, filters, sortby, date range etc. You can also use in-built reports or specify a direct query URL to get the desired data.</p>
<p><img loading="lazy" decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-source.png" alt="Custom SSIS Components - Google Web Analytics Source Connector" width="53" height="53" /> Read more about <a href="//zappysys.com/products/ssis-powerpack/ssis-google-analytics-source-connector/" target="_blank" rel="noopener"><span style="color: #248cc8;">Google Analytics Source Connector</span></a></p>
<h3>Features</h3>
<ul>
<li>The intuitive user interface makes Google Analytics data integration super easy and fast without learning complex APIs or scripting languages</li>
<li>Support for OAuth 2.0 Authentication and Google service accounts (*.p12 certificate file)</li>
<li>Support for Proxy Server</li>
<li>Easy to use interface with three different ways to query Google Analytics data: (1) Build query from UI, (2) Use built-in query templates, and (3) Use direct queries</li>
<li>Support for dynamic dimensions, metrics, segments, filters and sortby fields (e.g. supply these values at runtime)</li>
<li>Live preview support at design time</li>
<li>Support for AdWords, AdSense, Ad Exchange and DoubleClick for Publisher (DFP)</li>
</ul>
<h2>Setup Google analytics data permission for users / service account</h2>
<p>If you are not an admin of Google analytics and you need to access google analytics then make sure you ask admin to give you correct permission using below steps</p>
<p>To add/edit user permissions for Google Analytics Data perform following steps.</p>
<ol>
<li>Login to your Google Analytics Portal (Login using Admin account or use google user account who setup Google Analytics) <a href="https://analytics.google.com/analytics/web/#management/Settings/" target="_blank" rel="noopener">Click here</a> to go to google analytics</li>
<li>Click on Admin tab &gt; Click User management &gt; Add/Edit user account permission</li>
</ol>
<p>For more information you may visit official link : <a href="https://support.google.com/analytics/answer/2884495?hl=en" target="_blank" rel="noopener">How to setup permission for google analytics</a></p>
<div id="attachment_534" style="width: 808px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/01/set-permission-google-analytics-service-account.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-534" class="size-full wp-image-534" src="//zappysys.com/blog/wp-content/uploads/2016/01/set-permission-google-analytics-service-account.png" alt="Add/Edit Permissions and User Account for Google Analytics Data Access (Service Account/ Normal Google Login)" width="798" height="600" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/set-permission-google-analytics-service-account.png 798w, https://zappysys.com/blog/wp-content/uploads/2016/01/set-permission-google-analytics-service-account-300x226.png 300w" sizes="(max-width: 798px) 100vw, 798px" /></a><p id="caption-attachment-534" class="wp-caption-text">Add/Edit Permissions and User Account for Google Analytics Data Access (Service Account/ Normal Google Login)</p></div>
<div>
<h3>How to setup permissions for Service Account (*.p12 certificate)</h3>
<p>Service account is another method to access google data. This is useful when you don&#8217;t want to use google login to access data (Example: Some consultant working to setup automated jobs for your company and they don&#8217;t really have login for google or you don&#8217;t want to share your personal google login with them).</p>
<p>Service Account method (*.p12 certificate file) doesn&#8217;t require complex flow like OAuth so no more authorization prompts but make sure certificate generated for Service Account is kept secret.</p>
<p>To grant permission to service account so it can access google analytics data, First make sure Service Account is created and find account email (It may look like this account-1234@some-project-id-xyz.gserviceaccount.com ) . <a href="//zappysys.com/blog/create-google-api-project-service-account/" target="_blank" rel="noopener">Click here to know more how to create google service account</a>. Once service account created you may follow same steps described in above section to setup permission for Google Analytics Data.</p>
<h2>Access Google Analytics data using OAuth 2.0 authentication protocol</h2>
<p><img decoding="async" class="figureimage" title="Google Data Connection UI - Access Web Google Analytics data using OAuth 2.0 authentication protocol" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-access-google-analytics-data-using-oauth-2-authentication.png" alt="Google Data Connection UI - Access Google Web Analytics data using OAuth 2.0 authentication protocol" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>Access Google Analytics Data using service account method (*.P12 Certificate file)</h2>
<p><img decoding="async" class="figureimage" title="Google Data Connection UI - Access Google Web Analytics data using service account method (*.P12 Certificate file)" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-access-google-analytics-data-using-service-account.png" alt="SSIS Google Web Analytics Connector - Access data using service account method (*.P12 Certificate file) - Get data from Google Web Analytics Platform" /></p>
</div>
<p>&nbsp;</p>
<h2>SSIS Google Analytics Connector &#8211; Select Web Profile</h2>
<p><img decoding="async" class="figureimage" title="Google API - Select Web Profile" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-select-web-profile.png" alt="Google REST API - Select Web Profile" /></p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Using build your own query mode</h2>
<p><img decoding="async" class="figureimage" title="Google API - Automatic URL mode (Build your own query from UI)" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-automatic-mode.png" alt="Google REST API - Automatic URL mode (Build your own query from UI)" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Using direct query mode</h2>
<p><img decoding="async" class="figureimage" title="Google API - Manual URL mode (Supply predefined URL)" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-manual-url-mode.png" alt="Google REST API - Manual URL mode (Supply predefined URL)" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Predefined Report Templates</h2>
<p><img decoding="async" class="figureimage" title="Google API - Predefined Reports mode" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-template-report-mode.png" alt="Google REST API - Predefined Reports mode" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Report Preview</h2>
<p><img decoding="async" class="figureimage" title="Google API - Predefined Report Preview" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-report-template-preview.png" alt="Google REST API - Predefined Report Preview - Get data from Google Web Analytics Platform" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Select Dimensions</h2>
<p><img decoding="async" class="figureimage" title="Google API - Select Dimensions" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-select-dimensions.png" alt="Google REST API - Select Dimensions - Get data from Google Web Analytics Platform" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Select Metrics</h2>
<p><img decoding="async" class="figureimage" title="Google API - Select Metrics" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-select-metrics.png" alt="Google REST API - Select Metrics" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Select Filters</h2>
<p><img decoding="async" class="figureimage" title="Google API - Select Filters" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-select-filters.png" alt="Google REST API - Select Filters - Get data from Google Web Analytics Platform" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>SSIS Google Analytics Connector &#8211; Select Segment</h2>
<p><img decoding="async" class="figureimage" title="Google API - Select Segment" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-google-analytics-select-segment.png" alt="Google REST API - Select Segment" /></p>
</div>
<p>&nbsp;</p>
<div>
<h2>How to read google Adwords Data using Google Analytics Source</h2>
<p>If you wish to access Google AdWords data using Google Analytics source then refer instructions listed on AdWords Tab on the UI. Once you enable integration you can view AdWords data easily without any other connector (see below)</p>
</div>
<div id="attachment_862" style="width: 738px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/01/ssis-get-google-adwords-data-using-analytics-source-connector.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-862" class="size-full wp-image-862" src="//zappysys.com/blog/wp-content/uploads/2016/01/ssis-get-google-adwords-data-using-analytics-source-connector.png" alt="Get Data from Google AdWords using SSIS ( use Google Analytics Source Connector)" width="728" height="591" srcset="https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-get-google-adwords-data-using-analytics-source-connector.png 728w, https://zappysys.com/blog/wp-content/uploads/2016/01/ssis-get-google-adwords-data-using-analytics-source-connector-300x244.png 300w" sizes="(max-width: 728px) 100vw, 728px" /></a><p id="caption-attachment-862" class="wp-caption-text">Get Data from Google AdWords using SSIS ( use Google Analytics Source Connector)</p></div>
<div>
<p>&nbsp;</p>
<h2>SSIS Package &#8211; Get data from Google Web Analytics Platform and load into SQL Server</h2>
<p><img decoding="async" class="figureimage" title="SSIS Package - Get data from Google Web Analytics Platform and load into SQL Server" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/google-analytics-source/ssis-extract-google-analytics-data-load-into-sql-server-target.png" alt="SSIS Package - Get data from Google Web Analytics Platform and load into SQL Server" /></p>
</div>
<h2>Conclusion</h2>
<p>Integration with Google Analytics Data can be challenging unless you understand how to write C#, Java, Python code using Google SDKs. If you are not a coder or you are in time crunch then drag and drop integration in <strong>SSIS</strong> using High quality Connector using ZappySys <a href="//zappysys.com/products/ssis-powerpack/ssis-google-analytics-source-connector/"><span style="color: #248cc8;">Google Analytics Source Connector</span></a> will surely make your life easy. It supports all major SQL Server versions upto SQL Server 2016 32-bit/64-bit. Try <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a> yourself for FREE.</p>
<h2>Keywords</h2>
<p><strong>Fetch data from Google Web Analytics using SSIS</strong> | <strong>Extract google analytics data using SSIS</strong> | <strong>Load data from Google Analytics without Coding</strong> | <strong>Google Web analytics data import using REST API</strong></p>
<p><a href="https://developers.google.com/analytics/devguides/reporting/core/v3/" target="_blank" rel="noopener">Google Web Analytics Reporting REST API reference link</a></p>
<p>The post <a href="https://zappysys.com/blog/get-data-from-google-analytics-in-ssis-using-rest-api-call/">Get data from Google Analytics in SSIS using REST API Call</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
