Google Analytics conversion code

  • Posts: 36
  • Thank you received: 5
  • Hikashop Business
5 years 8 months ago #304889

-- HikaShop version -- : 3.2
-- Joomla version -- : 3.9.3
-- PHP version -- : 7.1

Hello,

I’m using HikaShop Business 3.2 and I have problem with Google Analytics Plugin. I need to count conversions from Google Ads campaign but conversion code is not displayed on any page (on any status).

Offer order was made status is Created. After we change status to Confirmed in backend still conversion is not counting.

When code should be displayed? On with screen?

Thank You for help.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 8 months ago #304897

Hi,

HikaShop has an integration with google analytics, not with Google Ads. So I'm not sure what "conversion code" you're talking about ?
If you want to get the transactions from Google Analytics in Google Ads, I would recommend to read this thread:
www.hikashop.com/forum/4-how-to/17871-go...nversion.html#304420

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

  • Posts: 36
  • Thank you received: 5
  • Hikashop Business
5 years 8 months ago #304914

I'm talking about code like this:

<!-- Event snippet for zakup conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': '5566',
'value': 1.0,
'currency': 'USD',
'transaction_id': ''
});
</script>

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 8 months ago #304924

Hi,

You'll want to add such code either in the after_end or end file of the "checkout" view via the menu Display>Views based on which payment method you're using on your website. Note that this will work when the customer finishes his order on your website, not when you change the status of the order in the backend.

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

  • Posts: 36
  • Thank you received: 5
  • Hikashop Business
5 years 7 months ago #305083

Ok, I fought that you have already made plugin. How to add to that code value of order? ('value': 1.0)

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 7 months ago #305085

Hi,

You can get the total amount of the order in the variable $this->order->order_full_price in these view files.

The following user(s) said Thank You: Bprak

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

  • Posts: 36
  • Thank you received: 5
  • Hikashop Business
5 years 7 months ago #305100

Thank You. May be in future it will be good idea to create that plugin.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 7 months ago #305113

Hi,

We have it on our todo list yes.

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

  • Posts: 13
  • Thank you received: 0
5 years 6 months ago #306530

How do i add the conversion code in which file?

so if possible i need the exact code and location of the file i have to put it in, also how and where :oops:

It's a very big mystery and very annoying that this will not work.

this is what we need:

The only thing that is important is the conversion value (order value). This is how we can offset the order value against the AdWords costs and, based on that, make the campaign plan with regard to positions, market share, etc etc ..

So Sales value must come in Analytics per source / medium (not everything as a set or direct).

Last edit: 5 years 6 months ago by Jheroen.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306532

Hi,

I cannot give a precise answer as it depends on how you configured your shop. Which payment plugins do you use and how are they configured ? Could you provide screenshots of the settings of your payment methods ?

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

  • Posts: 13
  • Thank you received: 0
5 years 6 months ago #306558

Hi Nicolas,

is it possible that you take a look into the website that should/could help limit the time needed for this problem ?

maybe you have the solution in a split second

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306563

Hi,

Without precise information, I can only give a vague answer.
If you need a precise information on what to add where exactly I need precise information regarding your setup.
While the website frontend would help (if you would give a link to it), if you could answer my questions above, it would help even more.

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

  • Posts: 13
  • Thank you received: 0
5 years 6 months ago #306588

Hi Nicholas, i will sent you a super admin login is that an idea?
Will do that by PB

and done

Last edit: 5 years 6 months ago by Jheroen.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306625

Hi,

I'm not familiar with ccIdeal so I don't know what page they use for the thank you page display.
You'll have to ask the support of ccIdeal which file needs to be changed.
Such code should work there:

<?php
if(!defined('DS'))
	define('DS',DIRECTORY_SEPARATOR);	include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php');
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$order = null;
if(!empty($order_id)) {
	$orderClass = hikashop_get('class.order');
	$order = $orderClass->loadFullOrder($order_id);
}

?>
<script>
gtag('event', 'conversion', {
'send_to': 'XXXX',
'value': <?php echo round($order->order_full_price,2); ?>,
'currency': 'EUR',
'transaction_id': '<?php echo $order->order_id; ?>'
});
</script>

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

  • Posts: 13
  • Thank you received: 0
5 years 6 months ago #306710

Hi Nicholas,

we can use your code in the thank you page when people order with iDeal ,but when they order with some of the other payment options they get a standard Hikashop page, in that pages (for each of the payment methods) should your code (also) appear, but how and where in which file?

and > are those changes overwritten when a hikashop update is done?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306724

Hi,

You can use the same code in the HikaShop thank you page.
To know which view file you want to edit you can activate the "Display view files" and display the page where you want to add that.
Then, you can edit the view file via the menu Display>Views and add the code I gave before.
If you do the changes via the Display>Views menu, you won't loose your changes when you update HikaShop.

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

  • Posts: 13
  • Thank you received: 0
5 years 6 months ago #306728

nicolas wrote: Hi,

You can use the same code in the HikaShop thank you page.
To know which view file you want to edit you can activate the "Display view files" and display the page where you want to add that.
Then, you can edit the view file via the menu Display>Views and add the code I gave before.
If you do the changes via the Display>Views menu, you won't loose your changes when you update HikaShop.


Okay thank you, where and how in which files do i implement the code the right way? It has to be only in the thank you page (s) that hikashop in this website uses for the active payment options

Last edit: 5 years 6 months ago by Jheroen.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 6 months ago #306735

Hi,

Supposing that you didn't enter a URL in the "return URL" of your payment methods, then it's either the "end" or the "after_end" file of the "checkout" view where you want to add that code. If you activate the "Display view files" setting as I was saying before and look at the thank you page, you should see which view file is used in the main area to display the thank you page and that way you'll know exactly which view file you want to change.

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

  • Posts: 13
  • Thank you received: 0
5 years 6 months ago #306754

nicolas wrote: Hi,

Supposing that you didn't enter a URL in the "return URL" of your payment methods, then it's either the "end" or the "after_end" file of the "checkout" view where you want to add that code. If you activate the "Display view files" setting as I was saying before and look at the thank you page, you should see which view file is used in the main area to display the thank you page and that way you'll know exactly which view file you want to change.


Nicolas, thanks for all your answers. How can i check if the end or after end file is in use as they have both the same content and both have the remove modifications sign. I can't find which one is attached to each payment method is there an easy way to find out or is it trial and error?
The message which appears after the order is done is nowhere to be found, searched for template overrides etc but nowhere to be seen. We are working a long time already to get this working but somehow it won't succeed :(
Can you help one time to find this?

Last edit: 5 years 6 months ago by Jheroen.

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

  • Posts: 36
  • Thank you received: 5
  • Hikashop Business
5 years 6 months ago #306773

Hi,

do you have some plugin that will display that aditional GA code: developers.google.com/analytics/devguide...s/enhanced-ecommerce ? Thank You for help.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum