utopia-php / analytics

Lite & fast micro PHP analytics library that is **easy to use**.
MIT License
14 stars 21 forks source link

Add IP and User Agent Methods to Adapters #24

Closed PineappleIOnic closed 2 years ago

PineappleIOnic commented 2 years ago

This PR adds setUserAgent and setClientIP methods to the plausible and google analytics adapter to allow easy modification of those variables once set without reinitialising the constructor.

eldadfux commented 2 years ago

Are we sure this method are not relevant for other adapters?

At least for the user-agent, it seems it might be common to use it for setting as a default header in our http call to the adapter API.

Do other providers allow us to set the IP?

PineappleIOnic commented 2 years ago

Looking at the GA Spec, we could use the UIP parameter to implement the same thing on GA. As for active campaign, I can't find anything in the API Spec that will allow us to do this.

eldadfux commented 2 years ago

I think it will make sense to move the new methods to the abstract class and ignore them on ActiviteCampaign