You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,42 @@ $analytics
108
108
->sendPageview();
109
109
```
110
110
This means that we are sending the request and not waiting for a response. The AnalyticsResponse object that you will get back has NULL for HTTP status code.
111
+
### Order Tracking with simple E-commerce
112
+
```php
113
+
use TheIconic\Tracking\GoogleAnalytics\Analytics;
114
+
115
+
$analytics = new Analytics();
116
+
117
+
// Build the order data programmatically, including each order product in the payload
118
+
// Take notice, if you want GA reports to tie this event with previous user actions
119
+
// you must get and set the same ClientId from the GA Cookie
120
+
// First, general and required hit data
121
+
$analytics->setProtocolVersion('1')
122
+
->setTrackingId('UA-26293624-12')
123
+
->setClientId('2133506694.1448249699');
124
+
125
+
// To report an order we need to make single hit of type 'transaction' and a hit of
126
+
// type 'item' for every item purchased. Just like analytics.js would do when
0 commit comments