Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

undefined variable $track on line 129 (ver. 1.2)
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: undefined variable $track on line 129 (ver. 1.2)

undefined variable $track on line 129 (ver. 1.2) 13 years, 10 months ago #20207

Hi,

I've installed new version (1.2.0) and got the following error message right after input credit card info and clicked final button.
The site is 'Joomla 1.5.22/Virtuemart 1.1.6'.

-----

Notice: Undefined variable: track in /home/xxx/public_html/plugins/system/gacode.php on line 129

Warning: sprintf() [function.sprintf]: Too few arguments in /home/xxxx/public_Notice: Undefined variable: track in /home/xxxx/public_html/plugins/system/gacode.php on line 129

Warning: sprintf() [function.sprintf]: Too few arguments in /home/xxxx/public_html/plugins/system/gacode.php on line 129html/plugins/system/gacode.php on line 129
xxxx Products

Notice: Undefined variable: track in /home/xxxx/public_html/plugins/system/gacode.php on line 129

Warning: sprintf() [function.sprintf]: Too few arguments in /home/xxxx/public_html/plugins/system/gacode.php on line 129

-----

I appreciate any help.
Thanks,

- Seiko

Re: undefined variable $track on line 129 (ver. 1.2) 13 years, 10 months ago #20237

  • jaku
Hello,
try resaving the plugin configuration and see if it helps.

Re: undefined variable $track on line 129 (ver. 1.2) 13 years, 10 months ago #20262

Hi,

I've checked the plugin config values in the database.
It didn't change at all after I resaved the config values.

 
uaCode=UA-xxxxxxx
trackEcommerce=1
trackConversions=0
conversionCode=
uaScript=
 


I've checked the code and it doesn't make sense to me.
Insdie the getCode function, there is a part that testing with old ga code, if '$this->purchace' value is false.

Here:
 
function getCode()
{
// load needed ORDER information
if ($this->purchase) $this->loadOrderData();
$vmTracking = ($this->purchase && $this->_params->get('trackEcommerce', 1)) ? $this->getVMTrackCode() : '';
$cTrack = $this->purchase && $this->_params->get('trackConversions', 1);
// = sprintf($this->_params->get('uaScript', $this->uaScript), $this->_params->get('uaCode', ''), $vmTracking);
 
$code = '';
 
// place to add conversion tracking code
if ($cTrack) {
$code .= "<div id=\"awtracking\"></div>\n";
}
 
if (!$this->purchase) {
// standard tracking code
$uaScript = $this->_params->get('uaScript', $this->uaScript);
if (strlen(trim($uaScript)) == 0) $uaScript = $this->uaScript;
 
$code .= sprintf($uaScript, $this->_params->get('uaCode', ''));
}
//if ($this->purchase) {
// test with old code
else {
$code .= $this->uaScriptOld;
 
// generate GA tracking
$code .= "<script type=\"text/javascript\">\n";
 
$code .= " try {\n";
$code .= " function GATrack() {\n";
//$code .= $vmTracking . "\n";
 
$code .= sprintf(" var pageTracker = _gat._getTracker(\"%s\");\n", $this->_params->get('uaCode', ''));
$code .= " pageTracker._trackPageview();\n";
$code .= $vmTracking = ($this->purchase && $this->_params->get('trackEcommerce', 1)) ? $this->getVMTrackCodeOld() : '';
//$code .= " alert('click!'); return false;\n";
 
$code .= sprintf($this->_params->get('uaScriptOld', $this->uaScriptOld), $track);
 
// if conversion tracking
if ($cTrack) {
$code .= " document.getElementById('awtracking').innerHTML = GATrackCode;\n";
}
//$code .= " alert('clicked!'); return false;\n";
$code .= " }\n";
 
// generate conversion tracking
if ($cTrack) {
$cCode = $this->_params->get('conversionCode', '');
$cCode = str_replace(array("\r\n", "\n", "script"), array(" ", " ", "scr' + ' ipt"), $cCode);
$code .= " var GATrackCode = '" . str_replace('%s', $this->totals['order_total'], $cCode) . "';\n";
}
// map code generation to button click
$code .= " document.adminForm.formSubmit.addEventListener('click', GATrack, true);\n";
$code .= " } catch(err) {}\n";
$code .= "</script>\n";
}
 
return $code;
}
 
 


Thanks for your help.

- Seiko

Re: undefined variable $track on line 129 (ver. 1.2) 13 years, 10 months ago #20270

  • jaku
Hello,
that is right, it is because the eCommerce transaction tracking does not work as supposed with the new GA assynchronous code in this case.
Do not know why, that is why for eCommerce tracking, older version of code is used.

I think the line 129
$code .= sprintf($this->_params->get('uaScriptOld', $this->uaScriptOld), $track); 

is forgotten there. Please, comment it out.

Re: undefined variable $track on line 129 (ver. 1.2) 13 years, 10 months ago #20277

Jan,

Thanks so much for your answer.
Now I understand why the old script is used.

Thanks again!

- Seiko

Re: undefined variable $track on line 129 (ver. 1.2) 13 years, 10 months ago #20295

Hi-Have the same problem. I can see the line of code you are referring to on line 129.
I'm just not sure if I'm suppose to remove it to fix the problem.
Will it still track sales?
  • Page:
  • 1
  • 2
Přihlášení uživatele Prázdný