[Skip to main content](#vessel-content)

#   Google Tag tracking

##

- **[askjim](/forum/user/44078-askjim "View askjim's Profile")**
- [![askjim's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44078-askjim "View askjim's Profile") Topic Author
- [ Offline](/forum/user/44078-askjim)

Less More

- Posts: 27
- Thank you received: 1
-
-

3 weeks 5 hours ago [\#100000540](#100000540) by [askjim](/forum/user/44078-askjim "View askjim's Profile")  *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000540 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")* was created by *[askjim](/forum/user/44078-askjim "View askjim's Profile")*

-- HikaShop version -- : 6.8.0
-- Joomla version -- : 6.2.0
-- PHP version -- : 8.4.27
-- Browser(s) name and version -- : Chrome 156.0

Hello,
I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53.
The HikaShop Google Analytics 4 plugin ( Code:

hikashop_ga4

) is enabled and successfully sends Code:

view_item

events to GA4.
However, when customers add products to the basket using the AJAX Add to Cart button, no Code:

add_to_cart

event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer.
The basket updates successfully, and the HikaShop AJAX request returns the correct product information.
Could you please confirm:

1. Does the HikaShop 6.8.0 GA4 plugin support the Code:

add_to_cart

event?
2. If so, is any additional configuration required for AJAX Add to Cart buttons?
3. If not, what is your recommended method for implementing GA4 Code:

add_to_cart

tracking?

Many thanks.
Jim

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

3 weeks 1 hour ago [\#100000541](#100000541) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000541 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")*

Hi,

HikaShop's Google Analytics 4 plugin did not send any add_to_cart event so far: up to version 1.5.9 it sent view_item_list, view_item, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase, so nothing was missing in your configuration.

We have added it: version 1.6.0 of the plugin, available now, sends an add_to_cart event each time a customer adds a product with an AJAX add to cart button, on the listings and on the product page, with the product's code and name, the quantity added, its unit price, the currency, its brand and its categories. It goes through the same gtag code as the other events, so it shows in Tag Assistant and in the dataLayer right after the click, and it follows your cookie consent setting like the rest of the plugin.

To get it, download the plugin from [ www.hikashop.com/marketplace/product/108...egration-google.html](https://www.hikashop.com/marketplace/product/108-integration-google.html) (or from your account, or Joomla's updater when it shows the update) and install it over the current one; your settings are kept. No other setting is needed.

If after the update the event still does not appear when you click the button, please tell us which button you use (a HikaShop add to cart button, or one built with YOOtheme Pro's builder) so that we can check how it calls the cart.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[askjim](/forum/user/44078-askjim "View askjim's Profile")**
- [![askjim's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44078-askjim "View askjim's Profile") Topic Author
- [ Offline](/forum/user/44078-askjim)

Less More

- Posts: 27
- Thank you received: 1
-
-

3 weeks 15 minutes ago [\#100000548](#100000548) by [askjim](/forum/user/44078-askjim "View askjim's Profile")  Replied by *[askjim](/forum/user/44078-askjim "View askjim's Profile")* on topic *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000548 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")*

Thank you Nicolas, I will have a look at this tomorrow.

Regard

Jim

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[askjim](/forum/user/44078-askjim "View askjim's Profile")**
- [![askjim's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44078-askjim "View askjim's Profile") Topic Author
- [ Offline](/forum/user/44078-askjim)

Less More

- Posts: 27
- Thank you received: 1
-
-

2 weeks 6 days ago [\#100000560](#100000560) by [askjim](/forum/user/44078-askjim "View askjim's Profile")  Replied by *[askjim](/forum/user/44078-askjim "View askjim's Profile")* on topic *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000560 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")*

Hi Nicolas

**Subject: GA4 plugin 1.6.0 – integration with YOOtheme Pro Consent Manager**
I'm using HikaShop 6.8.0 with the HikaShop GA4 plugin 1.6.0, Joomla 6.2.0 and YOOtheme Pro 5.0.53.

YOOtheme Pro's Consent Manager is configured for GDPR opt-in, with Google Analytics using Advanced Consent Mode.

The HikaShop GA4 plugin currently has **Cookie consent integration = None (track immediately)**.

I've found that the HikaShop plugin outputs &#96;gtag('config', 'G-*my tag code*')&#96; before YOOtheme outputs &#96;gtag('consent', 'default', ...)&#96;. As a result, &#96;_ga&#96; cookies are being created before visitors make a consent choice.

The GA4 ecommerce events, including &#96;add_to_cart&#96; and &#96;purchase&#96;, are working correctly, and I want to preserve them.

Could you please advise:

1. Can the **Custom JavaScript condition** option integrate with YOOtheme Pro's Consent Manager?
2. What JavaScript condition should be used?
3. Will this prevent GA4 initialisation before consent while allowing ecommerce events after consent is granted?

Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

2 weeks 6 days ago [\#100000564](#100000564) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000564 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")*

Hi Jim,

Yes, the Custom JavaScript condition setting can work with YOOtheme Pro's Consent Manager. Since you use Advanced Consent Mode, though, you do not want the plugin to wait for consent: in that mode Google's tag is meant to run from the start, as long as gtag('consent', 'default', ...) comes before gtag('config', ...). Your page has them in the wrong order because the plugin, with "None", adds its code in the head before the script YOOtheme adds at the end of the head.

The setting just needs to delay the plugin's code until the page has loaded, which is after YOOtheme's consent default. In the plugin's settings, set:

- Cookie consent integration: Custom JavaScript condition

- Use prior blocking: No

- The custom code: consentGiven = true;

With this, the plugin loads Google's tag and sends its events once the page is loaded. YOOtheme's consent default (analytics_storage denied until the visitor accepts) is already in place by then, so no _ga cookie is created before consent and the hits are sent as cookieless pings. When the visitor accepts in YOOtheme's banner, YOOtheme sends the consent update and the next events, add_to_cart and purchase included, are sent normally with the cookies. We tested this order with YOOtheme Pro's consent code as it appears on your home page: before the change the _ga cookie was created on page load and the hits carried no consent state; after it, no _ga cookie until the consent was granted, the hits were sent with consent denied, and the add_to_cart sent after accepting went with consent granted.

To answer your three questions:

1. Yes. YOOtheme Pro exposes the visitor's choice in JavaScript (yootheme.consent.hasConsent), so a condition can read it.

2. For Advanced Consent Mode, consentGiven = true; as above. If you ever switch to Basic Consent Mode (nothing sent to Google before consent), use the condition in the attached ga4-yootheme-strict-condition.txt instead. Keep in mind that the plugin then only starts on the page after the visitor accepts, so the events of the page where they click the banner are not sent.

3. Yes, with consentGiven = true; Google's tag only starts after YOOtheme's consent default, and the ecommerce events keep being sent, as cookieless pings before consent and normally after it.

One more thing we noticed on your site: Google Analytics is loaded twice with the same measurement ID, once by YOOtheme Pro's Google Analytics service (which is what outputs the consent default) and once by the HikaShop plugin. Each one calls gtag('config', ...), so GA4 records two page_view events for each page viewed. This is already the case today, and the change above does not affect it. The plugin's ecommerce events (view_item, add_to_cart, purchase...) are only sent once. If your page view numbers look doubled in GA4, that is the reason.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[askjim](/forum/user/44078-askjim "View askjim's Profile")**
- [![askjim's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/44078-askjim "View askjim's Profile") Topic Author
- [ Offline](/forum/user/44078-askjim)

Less More

- Posts: 27
- Thank you received: 1
-
-

2 weeks 6 days ago [\#100000569](#100000569) by [askjim](/forum/user/44078-askjim "View askjim's Profile")  Replied by *[askjim](/forum/user/44078-askjim "View askjim's Profile")* on topic *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000569 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")*

Following your advice, the GA4 consent integration is now working correctly. Thank you.

I've noticed a separate issue with the purchase event generated by HikaShop GA4 plugin 1.6.0.

For a test order, the values were:

Product: £13.50

Shipping: £4.50

Order total: £18.00

The GA4 purchase event reported:

value=18

shipping=4.5

tax=3

currency=GBP

Google's recommended GA4 ecommerce implementation excludes shipping and tax from the purchase value.

Is there a setting or supported method to change the HikaShop GA4 plugin's purchase value calculation without affecting the other ecommerce events?

I'd prefer to avoid modifying plugin source files, as changes could be overwritten by future updates.

Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

2 weeks 5 days ago [\#100000572](#100000572) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Google Tag tracking](/forum/36-reports-statistics/100000109-google-tag-tracking#100000572 "-- HikaShop version -- : 6.8.0 -- Joomla version -- : 6.2.0 -- PHP version -- : 8.4.27 -- Browser(s) name and version -- : Chrome 156.0  Hello, I'm using Joomla 6.2.0, HikaShop 6.8.0 and YOOtheme Pro 5.0.53. The HikaShop Google Analytics 4 plugin (  ) is enabled and successfully sends  events to GA4. However, when customers add products to the basket using the AJAX Add to Cart button, no  event appears in Google Tag Assistant, Chrome Network or the browser's Google data layer. The basket updates successfully, and the HikaShop AJAX request returns the correct product information. Could you please confirm:  &#42; Does the HikaShop 6.8.0 GA4 plugin support the  event?  &#42; If so, is any additional configuration required for AJAX Add to Cart buttons?  &#42; If not, what is your recommended method for implementing GA4  tracking?  Many thanks. Jim")*

Hi Jim,

There was no setting for it: the plugin always sent the order total as the purchase value, shipping and taxes included.

We have added one. Version 1.6.1 of the plugin, available now, has a new "Purchase value" setting with two choices:

- Order total: the total the customer paid, as until now (the default, so nothing changes until you switch it).

- Products, without shipping and taxes: the products after discounts and coupons, without shipping, payment fee and taxes, as Google recommends.

Shipping and tax are still sent in their own shipping and tax parameters either way, and the other ecommerce events (view_item, add_to_cart, begin_checkout...) are not affected. With the second choice, your test order would be sent with value=11.25 (your £13.50 product without its VAT), shipping=4.5 and tax=3. If you set a Google Ads purchase conversion label in the plugin, that conversion uses the same value as the purchase event.

To get it, download the plugin from [ www.hikashop.com/marketplace/product/108...egration-google.html](https://www.hikashop.com/marketplace/product/108-integration-google.html) (or from your account, or Joomla's updater when it shows the update) and install it over the current one: your settings, including the consent ones, are kept. Then select "Products, without shipping and taxes" in the plugin's "Purchase value" setting and save. No change to the plugin's files is needed, so future updates will keep it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy8xMDAwMDAxMDktZ29vZ2xlLXRhZy10cmFja2luZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.073 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
