Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I Created one Experiment by Following SDL Documentation. I can see all Component Presentations on my DD4T Web Application Page but when i click on my Experiment in CME to see the statistics it throws the Error says :

   com.tridion.smarttarget.SmartTargetException: java.util.concurrent.ExecutionException: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
  {
    "error" : "invalid_grant"
 }
at com.tridion.smarttarget.analytics.AnalyticsManager.getStatistics(AnalyticsManager.java:210) ~[smarttarget_core.jar:na]
at com.tridion.smarttarget.analytics.AnalyticsManager.getStatistics(AnalyticsManager.java:184) ~[smarttarget_core.jar:na]
at com.tridion.smarttarget.experiments.Experiment.loadStatistics(Experiment.java:198) ~[smarttarget_core.jar:na]
at com.tridion.smarttarget.webservices.experiments.ExperimentResolver.getExperimentsWithStatistics(ExperimentResolver.java:148) ~[smarttarget_api_webservice.jar:na]
at com.tridion.smarttarget.webservices.experiments.ExperimentResolver.resolveCollection(ExperimentResolver.java:57) ~[smarttarget_api_webservice.jar:na]
at com.tridion.webservices.odata.input.resolver.ResolverBase.resolve(ResolverBase.java:74) [cd_odata.jar:na]
at com.tridion.webservices.odata.input.handler.ODataFeedRenderer.renderODataFeed(ODataFeedRenderer.java:45) [cd_odata.jar:na]
at com.tridion.webservices.odata.input.handler.ODataWebserviceHandler.handleODataEntity(ODataWebserviceHandler.java:141) [cd_odata.jar:na]
at com.tridion.webservices.odata.input.handler.ODataWebserviceHandler.handleResourceRequest(ODataWebserviceHandler.java:117) [cd_odata.jar:na]

It seems Google Analytics API is not Authorizing the token (P12 key in our case), do i need to do anything different for OATH Authentication.

Note : I have Set Up Analytics mentioned in SDL Docs,and i can see Statistics for my DD4T Application Pages on https://analytics.google.com/analytics/

This is what i used in my Smart Target Config File :

  <Analytics implementationClass="com.tridion.smarttarget.analytics.google.GoogleAnalyticsManager" timeoutMilliseconds="5000" trackingRedirectUrl="/redirect/">
        <ServiceAccountEmailAddress>neelesh.raghuvanshi@tieto.com</ServiceAccountEmailAddress>
        <PrivatekeyPath>C:\NeelNew\Tieto Project-d6daec6b60f9.p12</PrivatekeyPath>
        <AccountId>74328616</AccountId>
        <TrackingId>UA-74328616-1</TrackingId>
        <ViewId>117415479</ViewId>
        <CustomDimensions>
            <ExperimentId>1</ExperimentId>
            <PublicationTargetId>2</PublicationTargetId>
            <PublicationId>3</PublicationId>
            <PageId>4</PageId>
            <Region>5</Region>
            <ComponentId>6</ComponentId>
            <ComponentTemplateId>7</ComponentTemplateId>
            <ChosenVariant>8</ChosenVariant>
        </CustomDimensions>
    </Analytics>

I wonder if Service Account Email Address is my Google Account through which i logged in to Google, is it true? Also please suggest me what i am missing. Do i neeed to do anything extra apart from the Documentation on SDL.

share|improve this question
up vote 8 down vote accepted

The Service Account Email, doesn't need to be the one you use to log on google analytics pages.

The Service Account Email is the one you use to generate de .p12 file.

Then in Google Analytics Admin of the site you want to use, this Account Service Email, must be granted in the "User Management" tab. With at least "Read and Analyze" permission.

Like in the image:

enter image description here

share|improve this answer
    
Although i am getting new error now which says com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid value 'ga:1==6ac8d87e-0498-4b5d-bf47-4591016a866b;ga:2==tcm:0-4-65537' for filters parameter.", "reason" : "invalidParameter" } ], Do i need to add any tracking code for components tracing, i am confused how it tracks components added in experiment – Neelesh Raghuvanshi Feb 26 at 11:15
    
Where ga:1 is PromotionId andga:2 is PublicationtargetId which i can see while debugging the experiments. – Neelesh Raghuvanshi Feb 26 at 11:31
    
I recommend you to post another question with the error in detail, as it seems different from the original cause. – Raúl Escudero Feb 26 at 11:49
    
I have Created a new question. tridion.stackexchange.com/questions/14041/…. Thanks – Neelesh Raghuvanshi Feb 26 at 12:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.