@
@
@mutant2013-01-15 10:03:38
Google
@mutant, 2013-01-15 10:03:38

Uploading Cost Data to Google Analytics Using PHP

There is the following task: daily, according to a schedule, upload data on advertising costs from Yandex.Direct, Begun, etc., and upload them to Google Analytics using the API.

In view of the lack of examples in the official Google documentation on how to implement such a download using the Google API client library for PHP (there are examples only for Java and Python), I had to dig into the code of the library itself, and nevertheless, the necessary function was found . Actually the question itself: how to feed this function a file with data on expenses?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Skakunov, 2013-01-15
@alex4

I didn’t use the library, but a quick reverse engineering shows that:
- you won’t be able to feed the file directly (and I think it would be strange - that’s what the API is for, so as not to mess with parsing files)
- the above function involves loading data for each day by separate call. $dateThe parameters and speak for this $appendNumber(I assume that this is the date and the amount for this day, respectively), as well as the class Google_DailyUploadAppend- “daily upload append” speaks for itself.
- the word "upload" is a little confusing.
It turns out that you need to run through the dates in the script and call this function in each iteration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question