Comments (6)
It may have to do with the guzzlehttp implementation, yes. This was done in this PR:
#6
A quick google of the issue guided me to this thread where I see you commented as well, I can see in our code that we are not using that tick
method mentioned.
guzzle/guzzle#1127
I'll look at this over the next few days, but if you think you can fix it feel free to open a PR for it.
from php-ga-measurement-protocol.
Asynchronous method should removed from future releases.
There are a whole bunch of issues in guzzle implementation regarding async requests.
As it is now in php-ga-measurement-protocol it is misleading and making people believe this works as reactphp/promise.
Down to the point. Curl implementation in PHP is not asynchronous.
from php-ga-measurement-protocol.
I'll remove it from the current README for the time being...
I'm pretty sure this was working as I test it personally in v1 using Guzzle 5, I think it was indeed using ReactPHP along with promises, check out the composer.lock to see that it was being required before https://github.com/theiconic/php-ga-measurement-protocol/blob/v1/composer.lock
However, it seems to have broken when we upgraded to Guzzle 6, if you check the current composer.lock, React is not there anymore.
I found a good article on how to make Guzzle 6 async using React: http://stephencoakley.com/2015/06/11/integrating-guzzle-6-asynchronous-requests-with-reactphp
But then again, I also want to implement Http Plug to not couple with Guzzle anymore http://httplug.io/
I'll study these options and see if I fix it or remove it altogether from the next big release. Thanks @borkor for reporting the bug.
from php-ga-measurement-protocol.
In general, you have to call wait() for the async requests with Guzzle (which kinda destroy the purpose)....
from php-ga-measurement-protocol.
so this bug still exists, I guess it's possible to fix?
from php-ga-measurement-protocol.
If async isn't working, the approach I'd take is to send all your analytics events after flushing the response, so that they don't slow down the page response time. If you're using PHP-FPM, you can flush the response using fastcgi_finish_request()
. This sends the response to the client and closes the connection, but still lets you execute some other PHP code.
from php-ga-measurement-protocol.
Related Issues (20)
- Can anyone write code for full Order refund in Enhanced Ecommerce ?
- Set Index for product
- Empty ClientId from GA cookie
- ?
- Incompatible return type with internal class
- Deprecated: http_build_query(), PHP 8.1.6
- Composer Dependency Problem
- How to pass options to HttpClient/Guzzle? HOT 2
- Social interactions broken HOT 2
- how do I add my own parameters? HOT 2
- Linking cross-domains
- How to control session duration? HOT 1
- update guzzle requirements HOT 3
- Missing orders in GA from Firefox in private mode
- Looking for Maintainers HOT 3
- Google Analytics 4 HOT 10
- Google Adsense
- Need new param on product currency HOT 1
- DebugResponse return null and no data send to GA HOT 4
- Adgang til Google My Business
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-ga-measurement-protocol.