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

#   In GA4 plugin - item\_id = product\_code?

##

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

Less More

- Posts: 282
- Thank you received: 42
-
-

1 year 5 months ago [\#367321](#367321) by [oxido](/forum/user/29793-oxido "View oxido's Profile")  *[In GA4 plugin - item\_id = product\_code?](/forum/36-reports-statistics/909457-in-ga4-plugin-item-id-product-code#367321 "-- HikaShop version -- : 5.1.6 -- Joomla version -- : 5.3.0 -- PHP version -- : 8.1 -- Browser(s) name and version -- : Google chrome  Hi,  Is this right or it was a mistake, shouldn't that be product&#95;id?  I ended up checking the plugin after noticing that my remarketing integration with newsman was no longer working. GA4 sends the product code to the dataLayer at &quot;product id&quot; instead of the id. I'm not saying it's wrong one way or another, I know that a long time ago when I did the integration everything worked ok with newsman and now it doesn't. I'm trying to figure out where the change was made that creates this situation for me now ::side:: For a future update, perhaps the option to choose from the plugin settings what information to send to the dataLayer would be useful. If I edit the plugin and make this change, will it still work ok with Google Analytics?")* was created by *[oxido](/forum/user/29793-oxido "View oxido's Profile")*

-- HikaShop version -- : 5.1.6
-- Joomla version -- : 5.3.0
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Google chrome

Hi, Code:

'item_id' =&gt; json_encode($product-&gt;product_code),

Is this right or it was a mistake, shouldn't that be product_id? Code:

'item_id' =&gt; json_encode($product-&gt;product_id),

I ended up checking the plugin after noticing that my remarketing integration with newsman was no longer working.
GA4 sends the product code to the dataLayer at "product id" instead of the id.
I'm not saying it's wrong one way or another, I know that a long time ago when I did the integration everything worked ok with newsman and now it doesn't.
I'm trying to figure out where the change was made that creates this situation for me now ::side::
For a future update, perhaps the option to choose from the plugin settings what information to send to the dataLayer would be useful.
If I edit the plugin and make this change, will it still work ok with Google Analytics?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy85MDk0NTctaW4tZ2E0LXBsdWdpbi1pdGVtLWlkLXByb2R1Y3QtY29kZT90bXBsPW1hcmtkb3du) or [Create an account](/register) 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: 86323
- Thank you received: 14283
-
-

1 year 5 months ago [\#367324](#367324) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[In GA4 plugin - item\_id = product\_code?](/forum/36-reports-statistics/909457-in-ga4-plugin-item-id-product-code#367324 "-- HikaShop version -- : 5.1.6 -- Joomla version -- : 5.3.0 -- PHP version -- : 8.1 -- Browser(s) name and version -- : Google chrome  Hi,  Is this right or it was a mistake, shouldn't that be product&#95;id?  I ended up checking the plugin after noticing that my remarketing integration with newsman was no longer working. GA4 sends the product code to the dataLayer at &quot;product id&quot; instead of the id. I'm not saying it's wrong one way or another, I know that a long time ago when I did the integration everything worked ok with newsman and now it doesn't. I'm trying to figure out where the change was made that creates this situation for me now ::side:: For a future update, perhaps the option to choose from the plugin settings what information to send to the dataLayer would be useful. If I edit the plugin and make this change, will it still work ok with Google Analytics?")*

Hi,

The product id is a number attributed automatically by HikaShop for internal use.
Also, GA doesn't have a field named "item_code".
And GA recommends you to use the "SKU" for the item_id:
[ support.google.com/analytics/answer/13782210?hl=en](https://support.google.com/analytics/answer/13782210?hl=en)
And the SKU of a product is usually stored in product_code.

So it's not a mistake. This is done like this because that's how it is supposed to be.
If your integration worked in the past, then I don't think you want to do this modification because the plugin has always used the product_code for the item_id. The problem must be elsewhere.

If you edit the code of the plugin with that change it should still work ok with GA. Note however that in your GA interface, you'll have your products in double. One product for the item_id with the id (from after the change) and one product for the item_id with the code (from before). So, you likely don't want to make that change.

The following user(s) said Thank You: [oxido](/forum/user/29793-oxido "View oxido's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy85MDk0NTctaW4tZ2E0LXBsdWdpbi1pdGVtLWlkLXByb2R1Y3QtY29kZT90bXBsPW1hcmtkb3du) or [Create an account](/register) 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.044 seconds

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