Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Note: This code assumes you have an authorized Analytics service object.
- * See the Data Import Developer Guide for details.
- */
- // This request uploads a file to a particular custom data source.
- try {
- $analytics->management_uploads->uploadData(
- '123456',
- 'UA-123456-1',
- '987654321',
- array(
- 'data' => file_get_contents('example.csv'),
- 'mimeType' => 'application/octet-stream',
- 'uploadType' => 'media'));
- } catch (apiServiceException $e) {
- print 'There was an Analytics API service error '
- . $e->getCode() . ':' . $e->getMessage();
- } catch (apiException $e) {
- print 'There was a general API error '
- . $e->getCode() . ':' . $e->getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement