Custom Tracking for VirtueMart Similar to Google Analytics

GK User
Sun Aug 25, 2013 7:35 pm
Dear Gavick,

I have a question about custom tracking .js code that I need to include on the site for VM. Here's the sample of the code:
Code: Select all
<script type="text/javascript">   
    var var1 = '11111';
    var var2 = '22222';
    var var3 = '33333';
</script>
<script type="text/javascript" src="https://tracking.js"></script>


How do I properly insert this code and where can I do that? Thank you in advance.
User avatar
Gold Boarder

GK User
Sun Aug 25, 2013 9:56 pm
Hi,
you can use 'Custom code' modules or plugins, you will find them on JED.
If you will choose modules - show them only on pages where you have VM.

There are few which should help you:
1) Phoca Site Plugin
2) EasyHeader
3) Easy Custom Code

Have fun :)
User avatar
Platinum Boarder

GK User
Sun Aug 25, 2013 11:06 pm
Pawel F wrote:Hi,
you can use 'Custom code' modules or plugins, you will find them on JED.
If you will choose modules - show them only on pages where you have VM.

There are few which should help you:
1) Phoca Site Plugin
2) EasyHeader
3) Easy Custom Code

Have fun :)

Hi Pawel,

Thanks for your fast and good response. That was very helpful. What if I need to add a code to one page and not the others, say, order confirmation page. How would I handle that with the mentioned extensions?
User avatar
Gold Boarder

GK User
Mon Aug 26, 2013 11:44 pm
How would I handle that with the mentioned extensions?


If you choose module sure, especially if you add this article into menu or you will use Advanced Module Manager.

Probably there are some others plugin that's allows you choose menu item. So always there is a option. I don't play all the time with them.
User avatar
Platinum Boarder

GK User
Tue Aug 27, 2013 5:48 am
Pawel F wrote:
How would I handle that with the mentioned extensions?


If you choose module sure, especially if you add this article into menu or you will use Advanced Module Manager.

Probably there are some others plugin that's allows you choose menu item. So always there is a option. I don't play all the time with them.


Pawel, but in general if I had to manually insert the code, would I just insert it as I listed it? I tried it like that, but Dreamweaver gave a syntax error.
User avatar
Gold Boarder

GK User
Thu Aug 29, 2013 9:01 pm
Why you use dreamwearer to edit Joomla site? I told you about modul not source code of template or joomla :geek:
User avatar
Platinum Boarder

GK User
Fri Aug 30, 2013 3:29 am
Pawel F wrote:Why you use dreamwearer to edit Joomla site? I told you about modul not source code of template or joomla :geek:

Hi Pawel, I understand. However, I had a specific question. I was not looking for a module to take care of the problem. Like I said, some code needs to be in the VM confirmation page. This page is being generated dynamically, so I won't be able to use the module in this case. That's why I was looking for a help. :)
User avatar
Gold Boarder

GK User
Sat Aug 31, 2013 9:04 pm
Like I said, some code needs to be in the VM confirmation page.


So you need to customize VM code, ask on VM forum maybe somebody did it before. Or you have to hire developer.
User avatar
Platinum Boarder

GK User
Mon Sep 02, 2013 3:44 am
Pawel F wrote:
Like I said, some code needs to be in the VM confirmation page.


So you need to customize VM code, ask on VM forum maybe somebody did it before. Or you have to hire developer.

Pawel, I am not looking for a custom code. I need to add a .js tracking code (I gave an example of how it might look). I am using your template and not sure where to insert that. I hope it's clear now. I just don't understand why you say I need a developer for this. :blush:
User avatar
Gold Boarder

GK User
Mon Sep 02, 2013 9:57 pm
So add Custom HTML module under VM shop as I told you before, see above.


I just don't understand why you say I need a developer for this.

For first solution you don't need, but if you want to add your own code inside VM without using a module you have to "hack" VM code. As you told me you need this JS code only on selected page(!) not all. The difficulty is to locate the file, which is responsible for this specific view. VM is not GK product, we don't give full support for all custom jobs in VM. Now I hope you understand why ? ;)
User avatar
Platinum Boarder

GK User
Mon Sep 02, 2013 10:07 pm
If I were you I would do it like that:

1) Custom HTML module or similar (insert your code inside) - publish module, don't show title
2) Install AdvancedModuleManager
3) Edit module again --> Module Assignment (TAB) --> Components (tab) --> VirtueMart

Then every time somebody use VM component browser will "see" your custom code.
But sure this is not good in your case,
so you have to you need to add additional condition, use URL (tab) and there insert URL of page which you want.

Save settings and test it.

Of course you have to check all AMM settings how they works etc.
User avatar
Platinum Boarder

GK User
Mon Sep 02, 2013 10:24 pm
If you'd like to play with code inside php check this:
templates\gk_esport\html\com_virtuemart\orders\details.php
or
templates\gk_esport\html\com_virtuemart\orders\details_items.php

I'm not sure which one is responsible for ....
User avatar
Platinum Boarder

GK User
Sat Sep 07, 2013 3:14 am
Pawel F wrote:If I were you I would do it like that:

1) Custom HTML module or similar (insert your code inside) - publish module, don't show title
2) Install AdvancedModuleManager
3) Edit module again --> Module Assignment (TAB) --> Components (tab) --> VirtueMart

Then every time somebody use VM component browser will "see" your custom code.
But sure this is not good in your case,
so you have to you need to add additional condition, use URL (tab) and there insert URL of page which you want.

Save settings and test it.

Of course you have to check all AMM settings how they works etc.


Hi Pawel, thank you for you detailed breakdown. I will try that and see if it works. Thank you so much.
User avatar
Gold Boarder

GK User
Sat Sep 07, 2013 10:54 pm
Pawel, it's a Conversion Tracking script that I need to add to order confirmation page in VM. As I said before, module would work fine if I could point it to that page. Since it's generating dynamically I can't do anything.

I guess my problem at the moment is how do I properly insert the code? If I insert it as-is, it gives me an error and isn't capturing anything. Any ideas?:)
User avatar
Gold Boarder

GK User
Sun Sep 08, 2013 7:53 am
Maybe you have use another custom HTML module, something like PRO.

Check:
1) EXT Custom HTML (Ext-Joom.com)
2) Blank Module (blackdale.com)
3) Custom HTML Advanced

Check those modules which allows you to use JS inside, this means that you can use any kind of code such as potential advertisers or Google .
User avatar
Platinum Boarder


cron