Jabb
Jabb

Reputation: 3502

How to migrate Google Analytics client side tracking to server side tracking using PHP

We would like to transfer all e-commerce transactions from our webshop via the server side, instead of using the javascript browser tracking script which is provided by Google.

From what I can see, it is possible to submit events from the server side to GA, but is it also possible to send the entire e-commerce transaction?

There are some options with regards to PHP libaries. Which ones do you currently use with good success?

Upvotes: 1

Views: 474

Answers (1)

Kemen Paulos Plaza
Kemen Paulos Plaza

Reputation: 1570

Hey it's not possible with Tag Manager(not on the easy way), but if you want to send hit via server side application the best way is go via "measurement protocol".

It's no so strange to do on that way, sometimes the transaction other important parameters can be sent on that way to secure the information. You only have to curl to a url.There is the guide of what it is https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide

But you need some consideration

  • You have to be able to read the cookie when you send the hit, or store the client id, to attach this information to the current user

  • If you want to send the information after, you have a max of 4 hours to send and to be attached correctly to the session. (there is parameter to do that)

Upvotes: 1

Related Questions