End of checkout for event tracking

  • Posts: 217
  • Thank you received: 4
8 years 2 months ago #248747

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2

Hello, I am searching for place where I can put my tracking code as purchase event. I tried end.php of view checkout, but it doesn't work for me. Can you suggest me another file? bank_transfer end work for me but I need it for all payment plugins.


Thank you
F.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 2 months ago #248748

Hi,

The "end" view file should work for all the payment plugins
What modification did you add there ?

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

  • Posts: 217
  • Thank you received: 4
8 years 2 months ago #248798

Hello,

this modification causes display issue for me:

ORIGINAL

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.6.3
 * @author	hikashop.com
 * @copyright	(C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->html)){
	echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
	echo $this->html;
}
$this->nextButton = false;


MY
<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.6.3
 * @author	hikashop.com
 * @copyright	(C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->html)){
	echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
	echo $this->html;
}
$this->nextButton = false;    

//tracking start
$full = $this->amount;
$full_int = filter_var($full, FILTER_SANITIZE_NUMBER_INT);  //sebrani jen cisel

?>

<script>
ga('send', {
  hitType: 'event',
  eventCategory: 'Order',
  eventAction: 'Purchase',
  eventLabel: 'Bank transfer',
  eventValue: <?php echo $full_int; ?>
});
  
  fbq('track', 'Purchase', {
    content_type: 'product',
    content_category: 'Bank transfer'
    value: <?php echo $full_int; ?>,
    currency: 'EUR'
});
</script>

<?php


after clicking on finish button only white blank page with this source code appears to me:
<div id="hikashop_checkout_page" class="hikashop_checkout_page hikashop_checkout_page_step3">
				<div id="hikashop_cart_bar" class="hikashop_cart_bar">
				<div class="hikashop_cart_step hikashop_cart_step_finished">
					<span>Your details</span>
				</div>				<div class="hikashop_cart_step hikashop_cart_step_finished">
					<span>Shipping and payment</span>
				</div>				<div class="hikashop_cart_step hikashop_cart_step_finished">
					<span>Review</span>
				</div>				<div class="hikashop_cart_step hikashop_cart_step_current">
					<span>Done</span>
				</div>			</div>


Thank you

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 2 months ago #248806

Hi,

The code looks fine. Cany ou try again after turning on the "error reporting" and "debug mode" settings of the joomla configuration page ? It should then display an error message at the bottom of the page which would help understand what is the problem.

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

  • Posts: 217
  • Thank you received: 4
8 years 2 months ago #248948

Hello, so I tried it. Problem was on the end of the file "<?php>

I putted tracking code in if -else statement, but pixel and event from analytics doesn't work. I if opened source code, there was only messy body and javascript nowhere.

Do you have any ideas?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 2 months ago #248968

There is no "<?php>" code in the previous code you provided... So I don't see what you're talking about.
What was the exact error message that you got ?
What if/else are you talking about ? There are no if/else in the code you provided.
Please provide the exact code you're using from when you get the error. If you provide another code, we can't help.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum