My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 376: Set called on unknown field: "items"
55 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----


Sign in to add a comment
 
Reported by [email protected], Dec 1, 2013
---------------------------------------------------------------------------
NOTE: This issue tracking system is for Google Analytics developer products
only.
If you are not a developer/programmer visit:
http://www.google.com/analytics/support.html
---------------------------------------------------------------------------
Name of affected component: Google Analytics (Beta) - Ecommerce Tracking

Name of related library and version, if applicable (e.g. Java, Python,
HTTP, Objective-C, etc.): Javascript

Issue summary:
On adding item for ecommerce tracking, API raise an error: Set called on unknown field: "items".

Steps to reproduce issue:
1. Setup analytics code on website.
2. Include ecommerce via require signal
3. Add transaction
4. Add item (raise error)
5. Send data (signal not registered with analytics server, not even for transaction)

Expected output:
Data being tracked in analytics account

Actual results:
No data visible

Notes:
Able to replicate by using sample code in the documentation.
Jan 14, 2014
#1 [email protected]
same story with me

Feb 5, 2014
#2 [email protected]
likewise here - if we remove custom variable name/val pair from the beacon the data is tracked as expected. 
Feb 6, 2014
#3 [email protected]
same here
Feb 13, 2014
#4 [email protected]
I have also started getting this error and it related to the 'name' parameter in the AddItem. Right now i can see the transaction being updated in the Analytics but the quantity field is not updated as it is related to AddItem.. I get this error: 

Running command: ga(ecommerce:send) analytics_debug.js:9
Set called on unknown field: "items". 

The transaction is added fine:
adSenseId        (&a)   207276765 analytics_debug.js:9
apiVersion       (&v)   1 analytics_debug.js:9
clientId         (&cid) 1565176868.1392320490 analytics_debug.js:9
ec:affiliation   (&ta)  TeamRaiser Donation analytics_debug.js:9
ec:id            (&ti)  1405 analytics_debug.js:9
ec:revenue       (&tr)  5.14 analytics_debug.js:9
ec:shipping      (&ts)  0.0 analytics_debug.js:9
ec:tax           (&tt)  0.0 

But the Item is not added and this is what i see in the console

<unknown>        (&ic)  1440 analytics_debug.js:9
<unknown>        (&in)  HtsDonationForm analytics_debug.js:9
<unknown>        (&ip)  5.14 analytics_debug.js:9
<unknown>        (&iq)  1 analytics_debug.js:9
<unknown>        (&iv)  1201 
Feb 19, 2014
#5 [email protected]
I am also getting the same error. Does anyone find the solution for this issue ?
Feb 19, 2014
#6 [email protected]
same here
Feb 20, 2014
#7 [email protected]
We're having the same problem on a site that's being developed in a subfolder of the old site's main domain. (site.com/beta)
The old site (site.com) has ga.js analytics code if that matters.

Here is the tracking code (located after the thank you page content):
<script type="text/javascript">	
ga('require', 'ecommerce', 'ecommerce.js');
  
ga('ecommerce:addTransaction', {
  'id': '1392907062',
  'affiliation': 'site.com',
  'revenue': '410.00',
  'shipping': '0.00',
  'tax': '82.00',
  'currency' : "HRK" 
});

ga('ecommerce:addItem', {
  'id': '1392907062',
  'name': 'shop .001.item',
  'sku': 'ROBA018971',
  'category': 'HLAČE',
  'price': '410.00',
  'quantity': '1'
});	

ga('ecommerce:send',{'hitCallback': function() {alert("ecommerce") ;}});

</script>

Does it matter that this code is placed after the page content and main analytics script is in header?
Feb 21, 2014
#8 [email protected]
Anybody have any luck?

@ivan, the main analytics.js should be in the head, so you should be good.

I have made sure to add the 'currency': 'USD', tried adding a callback function to indicate success...

After adding the analytics debug extension to Chrome, I see my values are all correct, but as @gaurav posted in #4, it's the actual addItems definition that's not working – and I've seen several posts complaining of the same with no resolution.
Feb 21, 2014
#9 [email protected]
Just for all those who have not solved, make sure that Analytics Ecommerce is enabled in the account if you weren't the one who set it up. ugh!
Feb 21, 2014
#10 [email protected]
Hi Greg, the Ecommerce is already enabled and the Transactions are working fine for me. Its only the AddItem function which is throwing me an error 

did you get it working ??

Feb 21, 2014
#11 [email protected]
Hi @gaurav, I had the exact same reporting issues as you mentioned in #4 (above) with the exception of my variables were populating correctly but Google's ec:id, ec:name, ec:sku, ec:category, ec:price, and ec:quantity were all <unknown>.

Since I hadn't setup the GA account, it never occurred to me that E-commerce was not 'ON', which obviously has something to do with addItems being instantiated.

My code will look a little different since I am using segment.io, but you can compare to see if there's something missing from your snippet:

$script .= <<<EOF
analytics.ready(function (){
 ga('require', 'ecommerce', 'ecommerce.js');
 ga('ecommerce:addTransaction', {
 'id': '{$transaction['id']}',
 'affiliation': '{$transaction['affiliation']}',
 'revenue': '{$transaction['revenue']}',
 'shipping': '{$transaction['shipping']}',
 'tax': '{$transaction['tax']}'
});
ga('ecommerce:addItem', {
 'id': '{$order_items['id']}',
 'name': '{$order_items['name']}',
 'sku': '{$order_items['sku']}',
 'category': '{$order_items['category']}',
 'price': '{$order_items['price']}',
 'quantity': '{$order_items['quantity']}'
});
ga('ecommerce:send');
});
EOF;
Feb 26, 2014
#12 [email protected]
I'm seeing the same issue. Set called on unknown field: "items" ecomerce is enabled but I'm also getting the error.

Set called on unknown field: "items"
Mar 4, 2014
#13 [email protected]
+1 for me the items fields are all showing up as <unknown>, except for ec:id.
Mar 4, 2014
#15 [email protected]
Ive just confirmed, this issue occurs even when using the examples found on the developer guidelines

https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
Mar 5, 2014
#16 [email protected]
I can confirm this. Both with my own code and the sample code from dev guidelines.
Mar 12, 2014
#17 [email protected]
I too like to confirm this.

Tested with and without GTM using own and sample code from the guidelines.
Mar 12, 2014
#18 [email protected]
I also would like to confirm this
Mar 20, 2014
#19 gerber.greg
+1

I see it in the logs when I turn on the debugging extension.  Does this mean the data is not being sent?

Executing Google Analytics commands. analytics_debug.js:9
Running command: ga(ecommerce:addTransaction, [object Object]) analytics_debug.js:9

Executing Google Analytics commands. analytics_debug.js:9
Running command: ga(ecommerce:addItem, [object Object]) analytics_debug.js:9

Executing Google Analytics commands. analytics_debug.js:9
Running command: ga(ecommerce:send) analytics_debug.js:9
Set called on unknown field: "items". 
Mar 21, 2014
#20 [email protected]
We experience the same issues, very annoying.
Mar 21, 2014
#21 [email protected]
Hey Guys, I have just found out that this error only corresponds to certain UA accounts. I used the same code for another client on the same platform and it works perfectly fine. 

I used exactly the same code as I discussed before in this thread...!!
Mar 24, 2014
Project Member #22 [email protected]
(No comment was entered for this change.)
Status: Accepted
Mar 26, 2014
#23 [email protected]
Tried to create new account couple of times with no luck. How is this medium priority when ecommerce is not working for some users?
Mar 29, 2014
#24 [email protected]
Initializing Google Analytics. analytics_debug.js:9
Registered new plugin: ga(provide, "linker", Function) analytics_debug.js:9
Registered new plugin: ga(provide, "displayfeatures", Function) analytics_debug.js:9
Loading resource for plugin: ecommerce analytics_debug.js:9
Loading script: "http://www.google-analytics.com/plugins/ua/ecommerce.js" analytics_debug.js:9
Running command: ga(create, UA-49506235-1, 99-dot-com-website-testing.com) analytics_debug.js:9
Creating new tracker: t0 analytics_debug.js:9
Running command: ga(send, pageview) analytics_debug.js:9

Sent beacon:
v=1&_v=j17d&a=1131207009&t=pageview&_s=1&dl=http%3A%2F%2Fwww.99-dot-com-website-testing.com%2Forderstatus.php%3Fid%3D5545&ul=en-us&d…77548975&_u=MCCC~&cid=1617463431.1396013038&tid=UA-49506235-1&z=1142524443

 analytics_debug.js:9
adSenseId        (&a)   1131207009 analytics_debug.js:9
apiVersion       (&v)   1 analytics_debug.js:9
clientId         (&cid) 1617463431.1396013038 analytics_debug.js:9
encoding         (&de)  UTF-8 analytics_debug.js:9
flashVersion     (&fl)  12.0 r0 analytics_debug.js:9
hitType          (&t)   pageview analytics_debug.js:9
javaEnabled      (&je)  1 analytics_debug.js:9
language         (&ul)  en-us analytics_debug.js:9
location         (&dl)  http://www.99-dot-com-website-testing.com/orderstatus.php?id=5545 analytics_debug.js:9
screenColors     (&sd)  24-bit analytics_debug.js:9
screenResolution (&sr)  1366x768 analytics_debug.js:9
title            (&dt)  99TShirts analytics_debug.js:9
trackingId       (&tid) UA-49506235-1 analytics_debug.js:9
viewportSize     (&vp)  1366x412 analytics_debug.js:9
Running command: ga(require, ecommerce, ecommerce.js) analytics_debug.js:9
Waiting on require of "ecommerce" to be fulfilled. analytics_debug.js:9
Executing Google Analytics commands. analytics_debug.js:9
Registered new plugin: ga(provide, "ecommerce", Function) analytics_debug.js:9
Running command: ga(require, ecommerce, ecommerce.js) analytics_debug.js:9
Plugin intialized on tracker "t0". analytics_debug.js:9
Running command: ga(ecommerce:addTransaction, [object Object]) analytics_debug.js:9
Running command: ga(ecommerce:addItem, [object Object]) analytics_debug.js:9
Running command: ga(ecommerce:send) analytics_debug.js:9
Set called on unknown field: "items". analytics_debug.js:9

Sent beacon:
v=1&_v=j17d&a=1131207009&t=transaction&_s=2&dl=http%3A%2F%2Fwww.99-dot-com-website-testing.com%2Forderstatus.php%3Fid%3D5545&ul=en-us&d…9506235-1&ti=15499-ORD&ta=99Tshirts&tr=5600&ts=0.00&tt=228.32&z=1928730599

 analytics_debug.js:9
adSenseId        (&a)   1131207009 analytics_debug.js:9
apiVersion       (&v)   1 analytics_debug.js:9
clientId         (&cid) 1617463431.1396013038 analytics_debug.js:9
ec:affiliation   (&ta)  99Tshirts analytics_debug.js:9
ec:id            (&ti)  15499-ORD analytics_debug.js:9
ec:revenue       (&tr)  5600 analytics_debug.js:9
ec:shipping      (&ts)  0.00 analytics_debug.js:9
ec:tax           (&tt)  228.32 analytics_debug.js:9
encoding         (&de)  UTF-8 analytics_debug.js:9
flashVersion     (&fl)  12.0 r0 analytics_debug.js:9
hitType          (&t)   transaction analytics_debug.js:9
javaEnabled      (&je)  1 analytics_debug.js:9
language         (&ul)  en-us analytics_debug.js:9
location         (&dl)  http://www.99-dot-com-website-testing.com/orderstatus.php?id=5545 analytics_debug.js:9
screenColors     (&sd)  24-bit analytics_debug.js:9
screenResolution (&sr)  1366x768 analytics_debug.js:9
title            (&dt)  99TShirts analytics_debug.js:9
trackingId       (&tid) UA-49506235-1 analytics_debug.js:9
viewportSize     (&vp)  1366x412 analytics_debug.js:9

Sent beacon:
v=1&_v=j17d&a=1131207009&t=item&_s=3&dl=http%3A%2F%2Fwww.99-dot-com-website-testing.com%2Forderstatus.php%3Fid%3D5545&ul=en-us&d…90111&ic=Couple%20Tshirt&iv=Couple%20%20T-shirts&ip=560&iq=10&z=1546816423

 analytics_debug.js:9
<unknown>        (&ic)  Couple Tshirt analytics_debug.js:9
<unknown>        (&in)  99-RF-100112-190/SJ:99-200122-190/SJ-990111 analytics_debug.js:9
<unknown>        (&ip)  560 analytics_debug.js:9
<unknown>        (&iq)  10 analytics_debug.js:9
<unknown>        (&iv)  Couple  T-shirts analytics_debug.js:9
adSenseId        (&a)   1131207009 analytics_debug.js:9
apiVersion       (&v)   1 analytics_debug.js:9
clientId         (&cid) 1617463431.1396013038 analytics_debug.js:9
ec:id            (&ti)  15499-ORD analytics_debug.js:9
encoding         (&de)  UTF-8 analytics_debug.js:9
flashVersion     (&fl)  12.0 r0 analytics_debug.js:9
hitType          (&t)   item analytics_debug.js:9
javaEnabled      (&je)  1 analytics_debug.js:9
language         (&ul)  en-us analytics_debug.js:9
location         (&dl)  http://www.99-dot-com-website-testing.com/orderstatus.php?id=5545 analytics_debug.js:9
screenColors     (&sd)  24-bit analytics_debug.js:9
screenResolution (&sr)  1366x768 analytics_debug.js:9
title            (&dt)  99TShirts analytics_debug.js:9
trackingId       (&tid) UA-49506235-1 analytics_debug.js:9
viewportSize     (&vp)  1366x412 

Mar 29, 2014
#25 [email protected]
i got this message
Apr 2, 2014
#26 [email protected]
Still happening. Analytics stores the 'transactions' (Conversions->Ecommerce->Transactions) but not the 'addItem'(There is no product tracked). You can experience the error (with the analytics debugger plugin installed) 'Set called on unknown field: "items". ' and you can see your items are not well defined:

<unknown>        (&ic)  T124C analytics_debug.js:9                                           <-- Should be 'Item Category'
<unknown>        (&in)  2 Medium 4 Toppings + Cokes analytics_debug.js:9     <-- Should be 'Item Name'
<unknown>        (&ip)  17.99 analytics_debug.js:9                                           <-- Should be 'Item Price'
<unknown>        (&iq)  1 analytics_debug.js:9                                                  <-- Should be 'Item quantity'
adSenseId           (&a)   2041674749 analytics_debug.js:9
apiVersion          (&v)   1 analytics_debug.js:9
clientId              (&cid) 776535948.1395091488 analytics_debug.js:9
ec:id                  (&ti)  177726564 analytics_debug.js:9
encoding           (&de)  UTF-8 


Apr 2, 2014
#27 [email protected]
I'm getting the same error using the code that google provided on their developer toolset. Looking forward to seeing some solutions. 

<unknown>        (&ic)  DD44 analytics_debug.js:9
<unknown>        (&in)  T-Shirt analytics_debug.js:9
<unknown>        (&ip)  11.99 analytics_debug.js:9
<unknown>        (&iq)  1 analytics_debug.js:9
<unknown>        (&iv)  Apparel analytics_debug.js:9
adSenseId        (&a)   1503818314 analytics_debug.js:9
apiVersion       (&v)   1 analytics_debug.js:9
clientId         (&cid) 1062405109.1395859112 analytics_debug.js:9
ec:id            (&ti)  1234 analytics_debug.js:9
encoding         (&de)  ISO-8859-1 analytics_debug.js:9
flashVersion     (&fl)  12.0 r0 analytics_debug.js:9
hitType          (&t)   item analytics_debug.js:9
javaEnabled      (&je)  1 analytics_debug.js:9
language         (&ul)  en-us analytics_debug.js:9
location         (&dl)  https://secure3.convio.net/bfre/site/Donation2?idb=1004832383&df_id=1700&1700.donation=completed&idb=1004832383 analytics_debug.js:9
screenColors     (&sd)  24-bit analytics_debug.js:9
screenResolution (&sr)  1920x1200 analytics_debug.js:9
title            (&dt)  Beaconfire Consulting analytics_debug.js:9
trackingId       (&tid) UA-3217754-13 analytics_debug.js:9
viewportSize     (&vp)  1905x1060 
Apr 14, 2014
#28 [email protected]
4/12 - Experiencing same issue with the google analytics. 'Set caleld on unknown field: "items".' Has anyone found a fix for this yet or are we still waiting for google to implement a fix?
Apr 14, 2014
#29 [email protected]
In my case, I figured out that's the issue is "associated" to your GA account. Contacted GA Support, after a few weeks of doing and undoing what they just did, the guy that apparently was in charge of this left Google. So we end-up reverting to old GA code.
Apr 14, 2014
#31 gerber.greg
RE: #30
I'm using the same ID for both and still have the issue.
Could the actual fix be that you're using a string instead of an int?
Apr 14, 2014
#32 [email protected]
I'm using the same string id but it does not work ...
Apr 14, 2014
#33 [email protected]
Deleted previous comment, double checked file after (even though it's working for me now) and I thought the error was gone (Set called on unknown field: "items".) but it's still there, just now at the top of all the calls.

Very weird. Sorry guys!
May 28, 2014
#34 [email protected]
Hi
i am getting the same error,
is there a fix for this issue?

Set called on unknown field: "id". analytics_debug.js:9
Set called on unknown field: "affliation". analytics_debug.js:9
Set called on unknown field: "revenue". analytics_debug.js:9
Set called on unknown field: "shipping". analytics_debug.js:9
Set called on unknown field: "tax". 
can some please help me on this?
Oct 10, 2014
Project Member #35 [email protected]
(No comment was entered for this change.)
Labels: -Component-CoreReportingAPI Component-TrackingCode
Jul 21, 2015
#36 [email protected]
-Component-CoreReportingAPI Component-TrackingCode 
Jul 22, 2015
#37 [email protected]
What's update on this? Still waiting for this to get fixed.
Sign in to add a comment

Powered by Google Project Hosting