Upload CSV Google Analytics Data File c# -


i'm trying upload csv file google analytics using c#. theirs example on google developers site here:

https://developers.google.com/analytics/solutions/articles/cost-data-import#custom_data_source

however, uses python. im trying rewrite using c#, isn't turning out easy thought. help?

don't know how implement media code sample site either, "csvtoupload" isn't doing anything. (csvtoupload csv file directory).

code snippet:

public void uploadcsvfile(string csvtoupload, string uploaddate, string accountid, string webpropertyid, string datasourceid)     {             filestream stream2 = new filestream(csvtoupload, filemode.open);          managementresource.dailyuploadsresource.uploadmediaupload dailyuploads = service.management.dailyuploads.upload(accountid, webpropertyid,             datasourceid, uploaddate, 1, managementresource.dailyuploadsresource.uploadmediaupload.typeenum.cost, stream2, "data test");          dailyuploads.reset = true;         //dailyuploads.uploadasync();         dailyuploads.upload();         stream2.close();     } 

wanted update code, , post see if me out, here's updated code quest.

any appreciated.

enter image description here

upload has second 1 lets send stream. load csv file stream , try , send way.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -