Post by MustWin » Wed Nov 23, 2016 10:19 pm

Hi there awesome people!

I'm interesting in the marketing tracking functionality that Open Cart provides. I'm running the latest version of OC.

If you go to Marketing -> Marketing Tracking it will let you add a new "trigger" that you can track and it looks like below:
http://www.mysite.com/path-to-something?tracking=5835a32c6f110

I'm interested in renaming the "tracking" variable to "t" or "ref" or something else than "tracking". Is this an easy change? Is there an option I may have overlooked while configuring OC?

Thank you so much for your help!
Eddie

Newbie

Posts

Joined
Wed Nov 23, 2016 10:12 pm

Post by opencartmart » Thu Nov 24, 2016 1:38 am

You can modify file catalog/controller/startup/startup.php using ocmod. I am considering t instead of tracking
You need to modify following lines of code:

Code: Select all

if (isset($this->request->get['tracking'])) {
			setcookie('tracking', $this->request->get['tracking'], time() + 3600 * 24 * 1000, '/');
		
			$this->db->query("UPDATE `" . DB_PREFIX . "marketing` SET clicks = (clicks + 1) WHERE code = '" . $this->db->escape($this->request->get['tracking']) . "'");
		}	
Replace by:

Code: Select all

if (isset($this->request->get['t'])) {
			setcookie('tracking', $this->request->get['t'], time() + 3600 * 24 * 1000, '/');
		
			$this->db->query("UPDATE `" . DB_PREFIX . "marketing` SET clicks = (clicks + 1) WHERE code = '" . $this->db->escape($this->request->get['t']) . "'");
		}

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by MustWin » Thu Nov 24, 2016 2:37 am

Hi opencartmart,

Thank you so much for your fast response!

I found the file and can make the changes. I have the Journal theme installed. Is ocmod a special editor? Can't I just use notepad++ to make the changes?

Thank you!
Eddie

Newbie

Posts

Joined
Wed Nov 23, 2016 10:12 pm

Post by opencartmart » Sat Nov 26, 2016 8:32 pm

OCmod is virtual file modification system so that you don't need to modify core file directly.

Please check https://github.com/opencart/opencart/wi ... ion-System

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 6 guests