javascript - Add google analytics data to a google slide -


//google slide id =  "thisisanoverlydifficultexercise"   function createslide(presentationid) {   // can specify id use slide, long it's unique.   var presentationid = "thisisanoverlydifficultexercise"   var pageid = utilities.getuuid();    var requests = [{     "createslide": {       "objectid": pageid,       "insertionindex": 1,       "slidelayoutreference": {         "predefinedlayout": "title_and_two_columns"       }     }   }];   var slide = slides.presentations.batchupdate({'requests': requests}, presentationid);   logger.log("created slide id: " + slide.replies[0].createslide.objectid); }   function getgoogleanalyticsdata() { var today = new date(); var oneweekago = new date(today.gettime() - 7 * 24 * 60 * 60 * 1000);  var startdate = utilities.formatdate(oneweekago, session.gettimezone(),'yyyy-mm-dd'); var enddate = utilities.formatdate(today, session.gettimezone(),'yyyy-mm-dd');  var tableid  = 'ga:123456'; var metric = 'ga:totalevents'; var options = {     'dimensions': 'ga:eventaction',     'sort': '-ga:totalevents',     'filters': 'ga:eventcategory==search content',     'max-results': 3 }; var report = analytics.data.ga.get(tableid, startdate, enddate, metric,options);  }  function readpageelementids(presentationid, pageid) {   // can use field mask limit data api retrieves   // in request, or fields updated in batchupdate. var presentationid = "thisisanoverlydifficultexercise"; var pageid = "thisisthepageofanoverlydifficultexercise";   var response = slides.presentations.pages.get(       presentationid, pageid, {"fields": "pageelements.objectid"});   logger.log(response); }  function addtextbox(presentationid, pageid) {   // can specify id use elements create,   // long id unique.   var presentationid = "thisisanoverlydifficultexercise";   var pageid = "thisisthepageofanoverlydifficultexercise";   var pageelementid = utilities.getuuid();    var requests = [{     "createshape": {       "objectid": pageelementid,       "shapetype": "round_rectangle",       "elementproperties": {         "pageobjectid": pageid,         "size": {           "width": {             "magnitude": 150,             "unit": "pt"           },           "height": {             "magnitude": 50,             "unit": "pt"           }         },         "transform": {           "scalex": 1,           "scaley": 1,           "translatex": 200,           "translatey": 100,           "unit": "pt"         }       }     }   }, {     "inserttext": {       "objectid": pageelementid,       "text": "this it",       "insertionindex": 0     }   }];   var response =       slides.presentations.batchupdate({'requests': requests}, presentationid);   logger.log("created textbox id: " +       response.replies[0].createshape.objectid); } 

i trying import google analytics data google slide. calling 3 pieces of information evident 'max-results': 3. want append these 3 pieces of information 3 separate round rectangles. "shapetype": "round_rectangle".

in code creating new slide within preexistent google slide document id = thisisanoverlydifficultexercise. newly created slide has id = thisisthepageofanoverlydifficultexercise. calling data google analytics api whom want append in new slide in form of text inside round rectangles.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -