nystudio107 / craft-instantanalytics-ga4

Instant Analytics brings full Google GA4 server-side analytics support to your Twig templates and automatic Craft Commerce integration
Other
3 stars 4 forks source link

Parameter "client_id" is required #7

Closed carolineboeykens closed 1 year ago

carolineboeykens commented 1 year ago

Describe the bug

We are getting an error when we add an item to our cart. This is the stacktrace:

Br33f\Ga4\MeasurementProtocol\Exception\ValidationException: Parameter "client_id" is required.
#9 /vendor/br33f/php-ga4-mp/src/Dto/Request/BaseRequest.php(276): Br33f\Ga4\MeasurementProtocol\Dto\Request\BaseRequest::validate
#8 /vendor/br33f/php-ga4-mp/src/Service.php(104): Br33f\Ga4\MeasurementProtocol\Service::send
#7 /vendor/nystudio107/craft-instantanalytics-ga4/src/ga4/Analytics.php(149): nystudio107\instantanalyticsGa4\ga4\Analytics::sendCollectedEvents
#6 /vendor/nystudio107/craft-instantanalytics-ga4/src/InstantAnalytics.php(318): nystudio107\instantanalyticsGa4\InstantAnalytics::nystudio107\instantanalyticsGa4\{closure}
#5 [internal](0): call_user_func
#4 /vendor/yiisoft/yii2/base/Event.php(312): yii\base\Event::trigger
#3 /vendor/yiisoft/yii2/base/Component.php(642): yii\base\Component::trigger
#2 /vendor/yiisoft/yii2/web/Response.php(343): yii\web\Response::send
#1 /vendor/yiisoft/yii2/base/Application.php(390): yii\base\Application::run
#0 /index.php(12): null

To reproduce

Steps to reproduce the behaviour:

  1. Install plugin
  2. On the frontend: add an item to cart
  3. See error message: Parameter "client_id" is required

Versions

khalwat commented 1 year ago

on it

bossanova808 commented 1 year ago

I was seeing this as well, but I turned this off in the settings - as I am not using the front end js:

image

The way I read that is that if not using said js, that should be off. Of course, if you are using the js, then I presume it should be on.

(of course in either state, it shouldn't prevent add to carts from happening, of course...)

khalwat commented 1 year ago

Addressed in 4.0.0-beta.2