Zen Cart Logo
Forums / General Questions / How to install Shopzilla revenue tracking script?

How to install Shopzilla revenue tracking script?

Views: 1,133

Results 1 to 5 of 5
16 Jan 2014, 5:15 PM
#1
sephowin avatar

sephowin

New Zenner

Join Date:
Jan 2014
Location:
new york
Posts:
3
Plugin Contributions:
0

How to install Shopzilla revenue tracking script?

I'am currently using zen cart, and I want to do marketing with shopzilla. They want to track my website order revenue.

They asked me to install

<script language="javascript"> <!-- /* Performance Tracking Data */ var mid = ''; var cust_type = ''; var order_value = ''; var order_id = ''; var units_ordered = ''; //--> </script> <script language="javascript" src="https://www.shopzilla. com/css/roi_tracker.js"></ script> in which file would i copy and paste this script to track the order revenue?
16 Jan 2014, 6:43 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to install Shopzilla revenue tracking script?

Did they tell you which page they want this on? I would think the order confirmation or checkout_success page would be it, but you need direction from them. In any case, you would not paste the code into any PHP file; you would rename them to start with jscript_ and save them in one of the /jscript/ folders, depending on what page they are needed in. The /jscript/ folders for a template or page will autoload all files that start with jscript_.
jscript_shopzilla_data.js
(do not include <script> tags in this file) ```

<!-- /* Performance Tracking Data */ var mid = ''; var cust_type = ''; var order_value = ''; var order_id = ''; var units_ordered = ''; //-->
jscript_shopzilla_tracker.js```
<script language="javascript" src="https://www.shopzilla. com/css/roi_tracker.js"></
script>
```I'm not certain of the way to call an external script in this format, so anyone with authoritative info, please chime in.

You also need to get the current order info into the script variables, which is another task. You might need to name the file jscript_shopzilla_data.php and include some PHP code to insert the variables.
16 Jan 2014, 8:01 PM
#3
sephowin avatar

sephowin

New Zenner

Join Date:
Jan 2014
Location:
new york
Posts:
3
Plugin Contributions:
0

Re: How to install Shopzilla revenue tracking script?

gjh42:

Did they tell you which page they want this on? I would think the order confirmation or checkout_success page would be it, but you need direction from them. In any case, you would not paste the code into any PHP file; you would rename them to start with jscript_ and save them in one of the /jscript/ folders, depending on what page they are needed in. The /jscript/ folders for a template or page will autoload all files that start with jscript_.
jscript_shopzilla_data.js
(do not include <script> tags in this file) ```

<!-- /* Performance Tracking Data */ var mid = ''; var cust_type = ''; var order_value = ''; var order_id = ''; var units_ordered = ''; //-->
> jscript_shopzilla_tracker.js```
<script language="javascript" src="https://www.shopzilla. com/css/roi_tracker.js"></
script>
```I'm not certain of the way to call an external script in this format, so anyone with authoritative info, please chime in.
> 
> You also need to get the current order info into the script variables, which is another task. You might need to name the file jscript_shopzilla_data.php and include some PHP code to insert the variables.

Hello,

Thank you GJH42 for the quick response, they asked me to paste the code to;

"Yes, the code would need to be placed on the order confirmation/thank you page as explained in the previous e-mails."

Are the files from /public_html/includes/templates/classic/templates,

either "tpl_checkout_confirmation_default.php" or "tpl_checkout_success_default.php"

I apologize for these questions I'am fairly new.

Thank you
16 Jan 2014, 9:51 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to install Shopzilla revenue tracking script?

I'm not certain which of those pages would be correct... but checkout_confirmation sends the info, while checkout_success may no longer have all of it.
In any case, you do not need to edit any existing PHP files, but put your added script code in jscript_ files. They would likely go in /includes/modules/pages/checkout_confirmation/, named as indicated above.

See the wiki for complete info on adding javascript:
http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates_-_Javascript

16 Jan 2014, 9:54 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to install Shopzilla revenue tracking script?

On reflection, I think the second file would be

jscript_shopzilla_tracker.php```php

<script language="javascript" src="https://www.shopzilla. com/css/roi_tracker.js"></ script> ``` The first file would also need to have the .php extension so that PHP variables can be processed.