Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tGoogleAnalyticsInput help required.

Hi,
I want to fetch Google Analytics (GA) data. For this, my friend added my google email as a user to his website GA. Now i can view his GA reports through my id. So this part is done.
I want to discuss three fields of tGoogleAnalyticsInput,
1.Application Name: Although it is not required but what should i enter here?
2.Service Account Email: i have given my google email address here as it has already been added as mentioned above.
3.Key File (*.p12): This is what confuses me. I've generated a p12 key file by turning my Analytics API to ON and following the required process.
My question is related to the 3rd field. Should i use p12 file that i generated or should i ask my friend to provide me his p12 key file?
any idea? Thanks in advance.
regards,
abdul.
Labels (2)
45 Replies
Anonymous
Not applicable
Author

There is an annoying bug in Talend that prevents the job from getting the necessary code from the component.

Hi Jan,
Sorry for popping up in your thread, but I suppose you have reported this issue already in JIRA?
Cheers,
Elisa
Anonymous
Not applicable
Author

Yes I have created an JIRA ticket to this issue.
@abdul: Please try this:
1. remove the file <studio_install_dir>/configuration/ComponentCache.javacache
2. check if the component is in the folder for user components (sometimes also called custom components)
3. open your preferences and navigate to Talend->Component and click on Apply.
Alternatively you can install the component via the Exchange view, this is by far the best way.
_AnonymousUser
Specialist III
Specialist III

Hi
i want to keep this value in a column with the data i extracted from GA. any idea how can i put this return value(CONTAINS_SAMPLED_DATA) in the data for each row.
if not possible top put this in the data flow. i want to throw and exception in tjava if this value is true? and don't know how to acess this value ???
CONTAINS_SAMPLED_DATA
--------------------------------
want to acess this values and store them.
Return values
Return value
Content
ERROR_MESSAGE
Last error message
NB_LINE
Number of delivered lines
CONTAINS_SAMPLED_DATA
True if data are sampled, means not exactly
calculated. This can happen if you query to
many details.
SAMPLE_SIZE
The amount of datasets used for the query
SAMPLE_SPACE
The amount of available datasets for this query
TOTAL_AFFECTED_ROWS
Number of rows which are collected by Google
to calculate the result.
Anonymous
Not applicable
Author

Hi  jlolling
I need help with the  tGoogleAnalyticsInput talend component. I have configured the job as per above comments but still im getting the below error. Please can you provide some help. Also attaching the screenshot of configuration and error.

Exception in component tGoogleAnalyticsInput_1
com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
{
  "error" : "invalid_grant"
}
Also i set the clock on my machine(On which talend is running) to sync time with internet. All screenshot attached below.

0683p000009MEKC.jpg 0683p000009MEYX.jpg 0683p000009MERK.jpg 0683p000009MESf.png
Anonymous
Not applicable
Author

Did you have enabled the access to the Analytics API in the Developer Console?
No this is not the problem. Please check if you have used the correct view-ID or better please check your request at first in the Google API Explorer.
Here the the google advices about errors:
https://developers.google.com/analytics/devguides/reporting/core/v3/coreErrors
and here the API explorer:
https://developers.google.com/apis-explorer/#s/analytics/v3/analytics.data.ga.get
Anonymous
Not applicable
Author

Thanks jlolling for the response,
All of the configuration were valid.but the issue was related to my silly mistake, there was leading space in the service account email ID in entered.It is resolved and job worked perfectly.
Thanks
Puneet
Anonymous
Not applicable
Author

Ok, I will take care in the next release such kind of mistakes does not matter anymore. 
Anonymous
Not applicable
Author

I get a similar error:
Exception in component tGoogleAnalyticsInput_1
com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
{
  "error" : "invalid_grant"
}
    at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
    at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
    at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
    at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:384)
    at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
    at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
disconnected
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
    at de.jlo.talendcomp.googleanalytics.GoogleAnalyticsInput.executeDataQuery(GoogleAnalyticsInput.java:352)
    at de.jlo.talendcomp.googleanalytics.GoogleAnalyticsInput.executeQuery(GoogleAnalyticsInput.java:417)
    at test.googleanalytics_0_1.googleAnalytics.tGoogleAnalyticsInput_1Process(googleAnalytics.java:575)
    at test.googleanalytics_0_1.googleAnalytics.runJobInTOS(googleAnalytics.java:1058)
    at test.googleanalytics_0_1.googleAnalytics.main(googleAnalytics.java:916)
No clues...
Anonymous
Not applicable
Author

jlolling,
Great piece of code. Thanks.
Quick question what is the best way to get the meta data from the various Google Analytics reports? I saw that someone was using a PreJob component before the tGoogleAnalyticsInput module. Is that required?
Thank sin advance.

Patrick