diff --git a/src/Ipunkt/LaravelAnalytics/Contracts/AnalyticsProviderInterface.php b/src/Ipunkt/LaravelAnalytics/Contracts/AnalyticsProviderInterface.php index d608a59..6c1f039 100644 --- a/src/Ipunkt/LaravelAnalytics/Contracts/AnalyticsProviderInterface.php +++ b/src/Ipunkt/LaravelAnalytics/Contracts/AnalyticsProviderInterface.php @@ -213,6 +213,15 @@ public function ecommerceAddItem($id, $name, $sku = null, $category = null, $pri */ public function setCustom($dimension, $value = null); + /** + * set a custom tracking ID (the UA-XXXXXXXX-1 code) + * + * @param string $trackingId + * + * @return AnalyticsProviderInterface + */ + public function setTrackingId($trackingId); + /** * enables Content Security Polity and sets nonce * diff --git a/src/Ipunkt/LaravelAnalytics/Providers/GoogleAnalytics.php b/src/Ipunkt/LaravelAnalytics/Providers/GoogleAnalytics.php index 451a528..fcad58f 100644 --- a/src/Ipunkt/LaravelAnalytics/Providers/GoogleAnalytics.php +++ b/src/Ipunkt/LaravelAnalytics/Providers/GoogleAnalytics.php @@ -733,4 +733,16 @@ protected function _getJavascriptTemplateBlockEnd() ? '' : ''; } + + /** + * set a custom tracking ID (the UA-XXXXXXXX-1 code) + * + * @param string $trackingId + * + * @return AnalyticsProviderInterface + */ + public function setTrackingId( $trackingId ) { + $this->trackingId = $trackingId; + return $this; + } } diff --git a/src/Ipunkt/LaravelAnalytics/Providers/NoAnalytics.php b/src/Ipunkt/LaravelAnalytics/Providers/NoAnalytics.php index fc7461a..c7b9d0f 100644 --- a/src/Ipunkt/LaravelAnalytics/Providers/NoAnalytics.php +++ b/src/Ipunkt/LaravelAnalytics/Providers/NoAnalytics.php @@ -306,4 +306,15 @@ public function cspNonce() { return null; } + + /** + * set a custom tracking ID (the UA-XXXXXXXX-1 code) + * + * @param string $trackingId + * + * @return AnalyticsProviderInterface + */ + public function setTrackingId( $trackingId ) { + return $this; + } }