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

Allow accessing BaseRequest object #31

Closed JeroenJRP closed 4 months ago

JeroenJRP commented 4 months ago

Hi, we're in as situation where the client wants us to send the timestamp with the GMP event. The br33f/php-ga4-mp library allows doing this with $baseRequest->setTimestampMicros($timestamp);, but the problem i'm running into is that this plugin doesn't allow access to the BaseRequest object. So my request is to change the visibilty of the request() method in ga4/Analytics.php from protected to public to allow setting extra properties on the BaseRequest when needed.

khalwat commented 4 months ago

Sounds reasonable to me!

khalwat commented 4 months ago

Addressed in the above commits

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-instantanalytics-ga4": "dev-develop as 3.0.2”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-instantanalytics-ga4": "dev-develop-v4 as 4.0.2”,

Then do a composer clear-cache && composer update