Where toplace Google Analytics code 4 conversions

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 month ago #127183

Please, use the code tag when you want to paste some code, please !!

Otherwise, your fix is right

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 0
11 years 1 week ago #132576

hikashop 2.2.2
Joomla 2.5

I have a similar issue and I don't know where to install the tracking google code. I tried pasting at the end of both "end" and "after_end" files as suggested at the beginning of the thread and they didn't work. So do I have the wrong file or is it pasted in the wrong location in the files?

I was told by the marketing team to place the "order confirmation" right before the </body>... however they were unfamiliar with hikashop...if that helps.

<script type=text/javascript>
var hostProtocol = (("https:" == document.location.protocol) ? "https" : "http");
document.write('<scr'+'ipt src="', hostProtocol+
'://101.xg4ken.com/media/getpx.php?cid=57e22848-b5e3-4e75-99df-4935f02def79','" type="text/JavaScript"><\/scr'+'ipt>');
</script>
<script type=text/javascript>
var params = new Array();
params[0]='id=57e22848-b5e3-4e75-99df-4935f02def79';
params[1]='type=conv';
params[2]='val=25';
params[3]='orderId=';
params[4]='promoCode=';
params[5]='valueCurrency=USD';
params[6]='GCID='; //For Live Tracking only
params[7]='kw='; //For Live Tracking only
params[8]='product='; //For Live Tracking only
k_trackevent(params,'101');
</script>

<noscript>
<img src=" 101.xg4ken.com/media/redir.php?track=1&t...D&GCID=&kw=&product= " width="1" height="1">
</noscript>

Last edit: 11 years 1 week ago by oxheadproductions.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 1 week ago #132710

There is no need to place any code anywhere. Simply configure the HikaShop Google Analytics plugin via the joomla plugins manager and it should work.

The following user(s) said Thank You: oxheadproductions

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 0
11 years 1 week ago #132728

Too easy. Thanks again.

Please Log in or Create an account to join the conversation.

  • Posts: 344
  • Thank you received: 3
11 years 5 days ago #133013

Can I use the " HikaShop Google Analytics plugin" for tracking Google Adwords Conversions also ?
....or does it only work for regular Google Analytics stats ?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 4 days ago #133064

It's for none of that.
adwords conversions and normal GA stats can be done with joomal plugins. This plugin sends GA ecommerce statistics:
support.google.com/analytics/answer/1037249?hl=en

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 0
11 years 4 days ago #133191

oxheadproductions wrote: Too easy. Thanks again.


Sorry I tried the plugin as suggested and the advertisement folks couldn't get the results they needed. So I gave them access to my joomla admin... and they attempted to install the code in the appropriate files... no luck again. This is there response....

"I checked my systems today and it still appears that the code is not showing up on your Order Confirmation page. Can you please reach out to Hika Shop and have them show you how to place custom code on the "Order Confirmation" page of your site. ....etc"

The custom code we are attempting to find a home for is....

<script type=text/javascript>
var hostProtocol = (("https:" == document.location.protocol) ? "https" : "http");
document.write('<scr'+'ipt src="', hostProtocol+
'://101.xg4ken.com/media/getpx.php?cid=57e22848-b5e3-4e75-99df-4935f02def79','" type="text/JavaScript"><\/scr'+'ipt>');
</script>
<script type=text/javascript>
var params = new Array();
params[0]='id=57e22848-b5e3-4e75-99df-4935f02def79';
params[1]='type=conv';
params[2]='val=25';
params[3]='orderId=';
params[4]='promoCode=';
params[5]='valueCurrency=USD';
params[6]='GCID='; //For Live Tracking only
params[7]='kw='; //For Live Tracking only
params[8]='product='; //For Live Tracking only
k_trackevent(params,'101');
</script>

<noscript>
<img src="101.xg4ken.com/media/redir.php?track=1&t...D&GCID=&kw=&product=" width="1" height="1">
</noscript>

Bottom line... where is the file found on my FTP or within Hikashop for the order "confirmation page"

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 4 days ago #133193

If you want to add tracking code in the confirmation page of HikaShop, you can edit the file "after_end" of the view "checkout" via the menu Display>Views provided that you didn't configure any return URL in your payment methods.

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 0
11 years 4 days ago #133199

...I have attempted to add the code to "after_end" file before without luck. I don't understand "configure any return URL in your payment methods" I'm assuming if I don't understand then I didn't do it.

Can you help me understand?... maybe this is the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 4 days ago #133205

When you edit a payment method via the menu System>Payment methods there is a "return URL" option there. It should be blank or it won't work.

Please Log in or Create an account to join the conversation.

  • Posts: 47
  • Thank you received: 0
11 years 4 days ago #133208

so far so good... yes the "return URL was blank. Perhaps the location of the tracking code within the "after_end" file will make a difference. I added the code at the end following this (my code for my after_end file)
*****************
<?php
/**
* @package HikaShop for Joomla!
* @version 2.2.2
* @author hikashop.com
* @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

*****************

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 3 days ago #133418

You should add your code at the beginning of that file.

The following user(s) said Thank You: tbroderick

Please Log in or Create an account to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum