From fffae3dd0bc1dc4f3c4abeb02ffd45ab45964d27 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Wed, 10 Dec 2025 11:48:51 -0600 Subject: [PATCH 1/8] Add event SelectPromotionEvent and ViewPromotionEvent. Update readme.md. --- README.md | 35 ++++--- src/Dto/Event/SelectPromotionEvent.php | 32 ++++++ src/Dto/Event/ViewPromotionEvent.php | 32 ++++++ src/Dto/Parameter/ItemParameter.php | 136 ++++++++++++++----------- 4 files changed, 162 insertions(+), 73 deletions(-) create mode 100644 src/Dto/Event/SelectPromotionEvent.php create mode 100644 src/Dto/Event/ViewPromotionEvent.php diff --git a/README.md b/README.md index cc9fc13..1cf8f07 100644 --- a/README.md +++ b/README.md @@ -131,21 +131,24 @@ $ga4Service->send($baseRequest); At the moment, the library contains the defined structures of the following events: | Event name | Structure | Documentation | | ---------- | --------- | --------------| -| add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#add_payment_info) -| add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#add_shipping_info) -| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#add_to_cart) -| add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?hl=fr&client_type=gtag#add_to_wishlist) -| begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#begin_checkout) -| login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#login) -| purchase | PurchaseEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#purchase) -| refund | RefundEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#refund) -| remove_from_cart | RemoveFromCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#remove_from_cart) -| search | SearchEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#search) -| select_item | SelectItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#select_item) -| sign_up | SignUpEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#sign_up) -| view_cart | ViewCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#view_cart) -| view_item | ViewItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#view_item) -| view_search_results | ViewSearchResultsEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#view_search_results) +| add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_payment_info) +| add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_shipping_info) +| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_cart) +| add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_wishlist) +| begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#begin_checkout) +| login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#login) +| purchase | PurchaseEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#purchase) +| refund | RefundEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#refund) +| remove_from_cart | RemoveFromCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#remove_from_cart) +| search | SearchEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#search) +| select_item | SelectItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_item) +| sign_up | SignUpEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#sign_up) +| view_cart | ViewCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_cart) +| view_item | ViewItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item) +| view_item_list | ViewItemListEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item_list) +| view_search_results | ViewSearchResultsEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_search_results) +| select_promotion | SelectPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_promotion) +| view_promotion | ViewPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_promotion) These events are sent analogously to the examples presented above. @@ -160,7 +163,7 @@ use Br33f\Ga4\MeasurementProtocol\Dto\Event\BaseEvent; // Create Service and request same as above // ... -// Create Base Event Data (for example: 'share' event - https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#share) +// Create Base Event Data (for example: 'share' event - https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#share) $eventName = 'share'; $anyEventData = new BaseEvent($eventName); $anyEventData diff --git a/src/Dto/Event/SelectPromotionEvent.php b/src/Dto/Event/SelectPromotionEvent.php new file mode 100644 index 0000000..36fe907 --- /dev/null +++ b/src/Dto/Event/SelectPromotionEvent.php @@ -0,0 +1,32 @@ +eventName, $paramList); + } +} diff --git a/src/Dto/Event/ViewPromotionEvent.php b/src/Dto/Event/ViewPromotionEvent.php new file mode 100644 index 0000000..bcc8a8a --- /dev/null +++ b/src/Dto/Event/ViewPromotionEvent.php @@ -0,0 +1,32 @@ +eventName, $paramList); + } +} diff --git a/src/Dto/Parameter/ItemParameter.php b/src/Dto/Parameter/ItemParameter.php index 8786f9e..9fc028c 100644 --- a/src/Dto/Parameter/ItemParameter.php +++ b/src/Dto/Parameter/ItemParameter.php @@ -127,6 +127,20 @@ class ItemParameter extends AbstractParameter implements HydratableInterface */ protected $itemListName; + /** + * The name of the list in which the item was presented to the user + * Not required + * @var string|null + */ + protected $promotionId; + + /** + * The name of the list in which the item was presented to the user + * Not required + * @var string|null + */ + protected $promotionName; + /** * The item variant or unique code or description for additional item details/options. * Not required @@ -171,62 +185,34 @@ public function __construct(?array $blueprint = null) */ public function hydrate($blueprint) { - if (array_key_exists('item_id', $blueprint)) { - $this->setItemId($blueprint['item_id']); - } - if (array_key_exists('item_name', $blueprint)) { - $this->setItemName($blueprint['item_name']); - } - if (array_key_exists('affiliation', $blueprint)) { - $this->setAffiliation($blueprint['affiliation']); - } - if (array_key_exists('coupon', $blueprint)) { - $this->setCoupon($blueprint['coupon']); - } - if (array_key_exists('currency', $blueprint)) { - $this->setCurrency($blueprint['currency']); - } - if (array_key_exists('discount', $blueprint)) { - $this->setDiscount($blueprint['discount']); - } - if (array_key_exists('index', $blueprint)) { - $this->setIndex($blueprint['index']); - } - if (array_key_exists('item_brand', $blueprint)) { - $this->setItemBrand($blueprint['item_brand']); - } - if (array_key_exists('item_category', $blueprint)) { - $this->setItemCategory($blueprint['item_category']); - } - if (array_key_exists('item_category2', $blueprint)) { - $this->setItemCategory2($blueprint['item_category2']); - } - if (array_key_exists('item_category3', $blueprint)) { - $this->setItemCategory3($blueprint['item_category3']); - } - if (array_key_exists('item_category4', $blueprint)) { - $this->setItemCategory4($blueprint['item_category4']); - } - if (array_key_exists('item_category5', $blueprint)) { - $this->setItemCategory5($blueprint['item_category5']); - } - if (array_key_exists('item_list_id', $blueprint)) { - $this->setItemListId($blueprint['item_list_id']); - } - if (array_key_exists('item_list_name', $blueprint)) { - $this->setItemListName($blueprint['item_list_name']); - } - if (array_key_exists('item_variant', $blueprint)) { - $this->setItemVariant($blueprint['item_variant']); - } - if (array_key_exists('location_id', $blueprint)) { - $this->setLocationId($blueprint['location_id']); - } - if (array_key_exists('price', $blueprint)) { - $this->setPrice($blueprint['price']); - } - if (array_key_exists('quantity', $blueprint)) { - $this->setQuantity($blueprint['quantity']); + $mapping = [ + 'item_id' => 'setItemId', + 'item_name' => 'setItemName', + 'affiliation' => 'setAffiliation', + 'coupon' => 'setCoupon', + 'currency' => 'setCurrency', + 'discount' => 'setDiscount', + 'index' => 'setIndex', + 'item_brand' => 'setItemBrand', + 'item_category' => 'setItemCategory', + 'item_category2' => 'setItemCategory2', + 'item_category3' => 'setItemCategory3', + 'item_category4' => 'setItemCategory4', + 'item_category5' => 'setItemCategory5', + 'promotion_id' => 'setPromotionId', + 'promotion_name' => 'setPromotionName', + 'item_list_id' => 'setItemListId', + 'item_list_name' => 'setItemListName', + 'item_variant' => 'setItemVariant', + 'location_id' => 'setLocationId', + 'price' => 'setPrice', + 'quantity' => 'setQuantity', + ]; + + foreach ($mapping as $key => $method) { + if (array_key_exists($key, $blueprint)) { + $this->$method($blueprint[$key]); + } } } @@ -298,6 +284,8 @@ public function export() 'item_category3' => $this->getItemCategory3(), 'item_category4' => $this->getItemCategory4(), 'item_category5' => $this->getItemCategory5(), + 'promotion_id' => $this->getPromotionId(), + 'promotion_name' => $this->getPromotionName(), 'item_list_id' => $this->getItemListId(), 'item_list_name' => $this->getItemListName(), 'item_variant' => $this->getItemVariant(), @@ -541,6 +529,40 @@ public function getItemListName(): ?string return $this->itemListName; } + /** + * @param string|null $promotionName + * @return ItemParameter + */ + public function setPromotionName(?string $promotionName): ItemParameter + { + $this->promotionName = $promotionName; + return $this; + } + /** + * @return string|null + */ + public function getPromotionName(): ?string + { + return $this->promotionName; + } + + /** + * @param string|null $promotionId + * @return ItemParameter + */ + public function setPromotionId(?string $promotionId): ItemParameter + { + $this->promotionId = $promotionId; + return $this; + } + /** + * @return string|null + */ + public function getPromotionId(): ?string + { + return $this->promotionId; + } + /** * @param string|null $itemListName * @return ItemParameter @@ -623,4 +645,4 @@ public function setQuantity(?float $quantity): ItemParameter return $this; } -} \ No newline at end of file +} From 77040dfd991e707922755ac5bab7a9f13737d857 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Wed, 10 Dec 2025 11:53:59 -0600 Subject: [PATCH 2/8] Fix readme --- README.md | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1cf8f07..fc5cc7d 100644 --- a/README.md +++ b/README.md @@ -131,25 +131,24 @@ $ga4Service->send($baseRequest); At the moment, the library contains the defined structures of the following events: | Event name | Structure | Documentation | | ---------- | --------- | --------------| -| add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_payment_info) -| add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_shipping_info) -| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_cart) -| add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_wishlist) -| begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#begin_checkout) -| login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#login) -| purchase | PurchaseEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#purchase) -| refund | RefundEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#refund) -| remove_from_cart | RemoveFromCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#remove_from_cart) -| search | SearchEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#search) -| select_item | SelectItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_item) -| sign_up | SignUpEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#sign_up) -| view_cart | ViewCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_cart) -| view_item | ViewItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item) -| view_item_list | ViewItemListEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item_list) -| view_search_results | ViewSearchResultsEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_search_results) -| select_promotion | SelectPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_promotion) -| view_promotion | ViewPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_promotion) - +| add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_payment_info) | +| add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_shipping_info) | +| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_cart) | +| add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_wishlist) | +| begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#begin_checkout) | +| login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#login) | +| purchase | PurchaseEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#purchase) | +| refund | RefundEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#refund) | +| remove_from_cart | RemoveFromCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#remove_from_cart) | +| search | SearchEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#search) | +| select_item | SelectItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_item) | +| sign_up | SignUpEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#sign_up) | +| view_cart | ViewCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_cart) | +| view_item | ViewItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item) | +| view_item_list | ViewItemListEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item_list) | +| view_search_results | ViewSearchResultsEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_search_results) | +| select_promotion | SelectPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_promotion) | +| view_promotion | ViewPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_promotion) | These events are sent analogously to the examples presented above. ### Other events From ae48410eb0c82508df4ee5f8286f3118249f1451 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Wed, 10 Dec 2025 11:57:50 -0600 Subject: [PATCH 3/8] Fix readme.md --- README.md | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index fc5cc7d..e36c038 100644 --- a/README.md +++ b/README.md @@ -129,26 +129,28 @@ $ga4Service->send($baseRequest); ``` At the moment, the library contains the defined structures of the following events: + | Event name | Structure | Documentation | | ---------- | --------- | --------------| -| add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_payment_info) | -| add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_shipping_info) | -| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_cart) | -| add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#add_to_wishlist) | -| begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#begin_checkout) | -| login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#login) | -| purchase | PurchaseEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#purchase) | -| refund | RefundEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#refund) | -| remove_from_cart | RemoveFromCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#remove_from_cart) | -| search | SearchEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#search) | -| select_item | SelectItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_item) | -| sign_up | SignUpEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#sign_up) | -| view_cart | ViewCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_cart) | -| view_item | ViewItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item) | -| view_item_list | ViewItemListEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_item_list) | -| view_search_results | ViewSearchResultsEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_search_results) | -| select_promotion | SelectPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#select_promotion) | -| view_promotion | ViewPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=17491993992317121377-NA&client_type=gtag#view_promotion) | +| add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_payment_info) | +| add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_shipping_info) | +| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_cart) | +| add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_wishlist) | +| begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#begin_checkout) | +| login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#login) | +| purchase | PurchaseEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#purchase) | +| refund | RefundEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#refund) | +| remove_from_cart | RemoveFromCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#remove_from_cart) | +| search | SearchEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#search) | +| select_item | SelectItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#select_item) | +| sign_up | SignUpEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#sign_up) | +| view_cart | ViewCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_cart) | +| view_item | ViewItemEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_item) | +| view_item_list | ViewItemListEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_item_list) | +| view_search_results | ViewSearchResultsEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_search_results) | +| select_promotion | SelectPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#select_promotion) | +| view_promotion | ViewPromotionEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_promotion) | + These events are sent analogously to the examples presented above. ### Other events From 509d4eddc8f3cbf4fda0bedaca818dcc193ead45 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Wed, 10 Dec 2025 12:00:00 -0600 Subject: [PATCH 4/8] Fix readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e36c038..0e67f6b 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ At the moment, the library contains the defined structures of the following even | ---------- | --------- | --------------| | add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_payment_info) | | add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_shipping_info) | -| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_cart) | +| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#add_to_cart) | | add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_wishlist) | | begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#begin_checkout) | | login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#login) | From 4e29900551ebc7723bf17842a959f4f37fd3ad5f Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Wed, 10 Dec 2025 12:02:05 -0600 Subject: [PATCH 5/8] Fix readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e67f6b..e36c038 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ At the moment, the library contains the defined structures of the following even | ---------- | --------- | --------------| | add_payment_info | AddPaymentInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_payment_info) | | add_shipping_info | AddShippingInfoEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_shipping_info) | -| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#add_to_cart) | +| add_to_cart | AddToCartEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_cart) | | add_to_wishlist | AddToWishlistEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#add_to_wishlist) | | begin_checkout | BeginCheckoutEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#begin_checkout) | | login | LoginEvent | [see documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/events#login) | From 9579957064c8cdf2fdae9fe31e38639f7e2a3baa Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Mon, 19 Jan 2026 15:38:52 -0600 Subject: [PATCH 6/8] Update package name and author information in composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index dbdb1ed..5829bbd 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { - "name": "br33f/php-ga4-mp", + "name": "ldani3l/php-ga4-mp", "description": "PHP GoogleAnalytics4 Measurement Protocol Library", "minimum-stability": "stable", "license": "MIT", "authors": [ { - "name": "Damian Zamojski", - "email": "damian.zamojski1@gmail.com" + "name": "Daniel Alvarez", + "email": "ingenierodaniel7@gmail.com" } ], "require": { From 90d49f9587594d89dd2d4839206c6aeef8f21413 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Mon, 19 Jan 2026 16:10:45 -0600 Subject: [PATCH 7/8] Add project type to composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 5829bbd..40346c8 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "description": "PHP GoogleAnalytics4 Measurement Protocol Library", "minimum-stability": "stable", "license": "MIT", + "type": "project", "authors": [ { "name": "Daniel Alvarez", From 7d8dc1e7ecb385fe4ec25b29445a3e65d13a6a4a Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Mon, 19 Jan 2026 16:11:13 -0600 Subject: [PATCH 8/8] Remove project type from composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 40346c8..5829bbd 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "description": "PHP GoogleAnalytics4 Measurement Protocol Library", "minimum-stability": "stable", "license": "MIT", - "type": "project", "authors": [ { "name": "Daniel Alvarez",