-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item categories have different & signs on view_item and view_item_list #357
Comments
@duracelltomi Could you please help us with this issue? |
Hi, Sorry, I was on vacation. Data in view_item is encoded to a JavaScript object using the json_encode PHP function which creates this output. |
@duracelltomi No problem! Hope you had a good one An example page ; https://www.bbqexperiencecenter.nl/modular-egg-workspace-met-kast-inclusief-big-green-egg-lar/ |
Did you have any chance to look into this already? Thanks in advance |
I did some testing recently but I am not sure this can be fixed in all places. For example on single product pages, product data is stored in an input node's value parameter. To make the code safe, I need to route the value through esc_attr() which will always encode & even if I revert back the encoding after calling json_encode. Revering back what esc_attr() returns will trigger signals in security checks. |
Hmm alright.. I understand the issue. Unfortunately this issue is giving us different information on the pages, so it's quite annoying for us. Couldn't you push the data with JS and parse it there? Could also become a filter to avoid problems in other scenario's |
We have some product categories with a & sign in them, but for some reason the view_item_list and view_item events show them differently, which is affecting our tracking of these categories.
VIEW ITEM LIST
VIEW ITEM
ecommerce: {
currency: "EUR",
value: 3332,
items: [
{
item_id: 892548,
item_name: "Modular Egg Workspace met kast inclusief Big Gree" +
"n Egg Large",
sku: "6017429198120",
price: 3332,
stocklevel: 10,
stockstatus: "instock",
google_business_vertical: "retail",
item_category: "Buitenkeuken & tafels",
item_category2: "Big Green Egg Modular Outdoor Workspace",
id: 892548,
item_brand: ""
}
]
}
We cant seem to find the reasons this is going wrong, it all seems the same function.
Do you have any idea? Or can you reproduce it?
The text was updated successfully, but these errors were encountered: