Skip to content

Commit

Permalink
Merge pull request #2 from markguinn/patch-1
Browse files Browse the repository at this point in the history
Quick fix to bug in universal analytics
  • Loading branch information
Mark Guinn committed Jul 21, 2015
2 parents c558a07 + 2df3bf4 commit 568de78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/ShopGoogleAnalytics.php
Expand Up @@ -45,7 +45,7 @@ class ShopGoogleAnalytics extends Object
* @return string
*/
public static function get_property_id() {
if (self::config()->disable_on_dev && !\Director::isLive()){
if (self::config()->disable_on_dev && !Director::isLive()) {
return '';
}

Expand Down
5 changes: 4 additions & 1 deletion code/ShopGoogleAnalyticsController.php
Expand Up @@ -45,7 +45,10 @@ public function addGASnippet($name, $order = false) {
$snippets = $cfg->tracking_code;

if (isset($snippets[$type]) && isset($snippets[$type][$name])) {
$js = $this->owner->renderWith($snippets[$type][$name], array('Order' => $order));
$js = $this->owner->renderWith($snippets[$type][$name], array(
'Order' => $order,
'GAWebPropertyID' => $this->GAWebPropertyID(),
));
}

if (!empty($js)) {
Expand Down
2 changes: 1 addition & 1 deletion templates/GAConversion.ss
Expand Up @@ -4,7 +4,7 @@ ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': '$JS_val(Reference)',
'affiliation': '$Top.SiteConfig.JS_val(Title)',
'revenue': '$Total.RAW'
'revenue': '$Total.RAW',
'shipping': '$GAShippingTotal',
'tax': '$GATaxTotal',
});
Expand Down

0 comments on commit 568de78

Please sign in to comment.