Skip to main content
Solved

JDBC Driver for Google Analytics GA4 data model

  • September 10, 2025
  • 1 reply
  • 44 views

Forum|alt.badge.img

Hi all, 

I kindly need help on this one. While checking the documentation CData JDBC Driver for Google Analytics - GoogleAnalytics4 Data Model , I noticed that there are no metrics or dimension related to 

TAX, DISCOUNT, SHIPPING ,REFUND. These informations were present in the universal model.

From the documentation say this in the EcommPurchaseItemIdReport (see boxed part of screenshot) , but the Column names and the description do not match. and after querying the data, it proved that they indeed do not match .


 

 



 

Best answer by Ethem Q

Hi ​@Nelson_christof ,

 

Have you tried looking at the CreateCustomSchema Stored procedure? The stored procedure should allow you to set your dimensions and metrics of choice and create a view based on them. That said, querying this newly created view should give you a new report with the results you are looking for.


To run a stored procedure, you can follow the syntax here: https://cdn.cdata.com/help/DAM/jdbc/pg_GoogleAnalytics4sp-createcustomschema.htm and specify the right input parameters to create your own custom schema for GA4 queries.

You can learn more about the dimensions and metrics in the GA4 API docs:
https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema 
To understand the correct combinations of dimensions and metrics, you can play around with the GA Dimensions and Metrics Explorer: https://ga-dev-tools.google/ga4/ 

For your convenience, I am providing an example below:

EXECUTE CreateCustomSchema @TableName='CustomEcommReport',        @Dimensions='date,transactionid,streamid,streamname', @Metrics='refundAmount,taxAmount,shippingAmount,totalRevenue,transactions,keyEvents';

Regarding the incorrect description of the PurchaseToViewRate and ItemPurchased columns in the documentation, we have raised this with the documentation team. Thank you for reporting this!

Should you have any issues or any other questions, please reach out to [email protected] with your inquiry.

This topic has been closed for replies.

1 reply

Ethem Q
Forum|alt.badge.img
  • Employee
  • Answer
  • September 10, 2025

Hi ​@Nelson_christof ,

 

Have you tried looking at the CreateCustomSchema Stored procedure? The stored procedure should allow you to set your dimensions and metrics of choice and create a view based on them. That said, querying this newly created view should give you a new report with the results you are looking for.


To run a stored procedure, you can follow the syntax here: https://cdn.cdata.com/help/DAM/jdbc/pg_GoogleAnalytics4sp-createcustomschema.htm and specify the right input parameters to create your own custom schema for GA4 queries.

You can learn more about the dimensions and metrics in the GA4 API docs:
https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema 
To understand the correct combinations of dimensions and metrics, you can play around with the GA Dimensions and Metrics Explorer: https://ga-dev-tools.google/ga4/ 

For your convenience, I am providing an example below:

EXECUTE CreateCustomSchema @TableName='CustomEcommReport',        @Dimensions='date,transactionid,streamid,streamname', @Metrics='refundAmount,taxAmount,shippingAmount,totalRevenue,transactions,keyEvents';

Regarding the incorrect description of the PurchaseToViewRate and ItemPurchased columns in the documentation, we have raised this with the documentation team. Thank you for reporting this!

Should you have any issues or any other questions, please reach out to [email protected] with your inquiry.