Datalayer Analytics - analytics

i have the next datalayer of purchase to send google analytics:
dataLayer.push({
'event': 'ActivarTransaccion',
'ecommerce': {
'purchase': {
'actionField': {
'id': '46234462',
'affiliation': '001000',
'revenue': 189,
'tax': 0.00
},
'products': [{
'id': 'PGA720084778',
'name': 'PGA720084778',
'category': 'category',
'price': 189,
'brand': 'brand',
'quantity': 1,
'dimension1': '',
'dimension2': 'K 1200',
'dimension3': 'GT',
'dimension4': '',
'dimension5': 'A',
'dimension6': 'dim',
'dimension7': 'dim',
'dimension8': 'date',
'dimension9': 'moto',
'dimension10': 'cp',
'metric2': '42',
'metric3': '22',
'metric4': '10',
'metric5': '10',
'metric6': '189'
}]
}
}
});
However, the data is not sending to google analytics to register ecommerce, what is wrong, could you help me?

The code looks like it fires correctly. The data layer itself doesn't send to Google Analytics, so have you checked how your Google Tag Manager configuration is set up? The way this is structured here would mean that an event tag would send the data.
Creating a tag like below would tell the tag to fire on the 'ActivarTransaccion' data layer event and to use the data layer for the ecommerce information.
Tag type : Universal Analytics
Track type : Event (then add cat, action, label)
Enable Enhanced Ecommerce Features: true
Use Data Layer: true
Trigger: event equals ActivarTransaccion (custom event trigger)
Once that is complete and tested in the GTM debug mode, you will also have to enable Enhanced Ecommerce in the view by going to Admin > View Column > Enhanced Ecommerce Settings > Enable Ecommerce and Enable Enhanced Ecommerce.
If these are already done, the next step would be to check the logic on the site that dynamically pushes this code.

Related

Why is the Sencha Ext.List component not recognized

I'm trying to use the "Ext.dataview.List" in my sencha application, but I'm receiving the following error when loading the page that contains the component:
Uncaught Error: [Ext.create] Unrecognized class name / alias: Ext.List
I tried to add multiple requires to the page (Ext.dataview.List, the ones listed in the "Requires" of the component documentation..) but without success. I'm kinda lost on what could be happening, and I haven't found any specific information of what could be the problem. I've never had this problem with another components, just indicating the "xtype" works okay.
Someone has an idea of which can be the problem?
I'm creating the component like this, with sencha version 6.2:
var list = Ext.create('Ext.List', {
fullscreen: true,
itemTpl: '{title}',
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
});
There are Two toolkits for EXJS : Classic and Modern. The Classic Toolkit is essentially Ext JS 5’s view layer and is used to create Desktop applications.
The Modern Toolkit is for targeting modern browsers from Desktop to Mobile and, at this stage, is made up of Sencha Touch’s view layer.
Currently there is no "EXt.List" in Classic toolkit. To solve this problem make sure you're using the Modern version or change your approach to your desired result.

Google Smart Home - TemperatureSetting Temperature Range not working

I made a google Smart Home able to control a water heater pump with google smarthome touch control. What it need to control is desired temperature and mode (on off).
I was not able to make that work with the "heater" device so instead I use the "thermostat" device.
Everything work except one thing : the temperature range.
In my onSync request I enter a range between 60F° and 104F°, but it doesn't work on the device.
My min is 50F° and My max is 90F°
Here my onSync request.
function onSync(firebaseRef) { return async (body, headers) => {
return {
requestId: body.requestId,
payload: {
agentUserId: uId,
devices: [{
id: pId,
type: 'action.devices.types.THERMOSTAT',
traits: [
'action.devices.traits.TemperatureSetting',
],
name: {
defaultNames: ['My Heat Pump'],
name: 'Heat Pump',
nicknames: ['Pump'],
},
deviceInfo: {
manufacturer: 'test',
model: '1',
hwVersion: '1.0',
swVersion: '1.0.1',
},
willReportState: true,
attributes: {
// TemperatureSetting
availableThermostatModes: 'off,heat',
thermostatTemperatureRange: {
minThresholdCelsius: 15.555,
maxThresholdCelsius: 40.0
},
thermostatTemperatureUnit: 'F'
},
}],
},
};
}
}
Do you know how to get the good temperature range ?
Bonus : It is possible to have a temperature touch control working with something else like a heater ?
I had this answer from u/devunwired on Reddit:
In my onSync request I enter a range between 60F° and 104F°, but it
doesn't work on the device.
This is a known issue that the Google Home app does not currently render the temperature range provided (the value is respected in voice
queries). You can follow (and start) the feature request here:
b/154169625
Permalink: https://www.reddit.com/r/GoogleAssistantDev/comments/guoyih/temperaturesetting_temperature_range/fskfx4f/

GTM not firing DOM and Window Loaded triggers

I recently added a dataLayer on our product and checkout pages for Google Analytics enhanced ecommerce, following the conventions found on Simo's blog. However, something strange has happened since we've added the dataLayer - the gtm.load and gtm.dom calls are no longer firing.
If I do a hard refresh, clear my cookies and go through the flow one time, everything seems to fire properly. However, once I go back to home page or some other part of the site, I only see the gtm.js getting fired and none of my triggers work.
For example, the navigation flow is home page -> product listing -> product detail. The site is a React single page app so I have a history event trigger to fire GA tags. If I'm a new user, and I go through those 3 pages, I will see the following fire in the dataLayer (as expected): gtm.js, gtm.dom, gtm.load, gtm.history. However, if I go back to the home page and go through the flow again, the gtm.dom and gtm.load dataLayer objects disappear and as a result my GTM triggers never fire. See images below for examples of what the dataLayer looks like on the product detail page for the above flow.
I'm at a loss here as I've never seen gtm.load not fire
Data Layer code on product listing page:
var window.dataLayer = window.dataLayer || []
dataLayer.push({
'ecommerce': {
'currencyCode':'CAD',
'impressions': [ //the array of products present within the listing
{ 'id':'123456', // Product SKU
'name':'GOOD FOOD', // Product Name
'price':'7.20', // Display price - use only xxxx.xx formatting
'brand':'No Name', // Product Brand
'category':'Food',
'position':0, // Product position within the list
'list':'Products page' // leave as is
}, { //second product
'id':'456890',
'name':'ABC Nuts',
'price':'8.50',
'brand':'ABC',
'category':'Food',
'position':1,
'list':'Products page'
},
...
{
'id':'1001010',
'name':'Fish Oil',
'price':'95.00',
'brand':'Zenn',
'category':'Oil',
'position':21,
'list':'Products page'
}
]
}
}); </script>
dataLayer on Product Detail Page:
<script>
var window.dataLayer = window.dataLayer || []
dataLayer.push({
'event': 'detail',
'ecommerce' : { 'detail' :
{ 'products' : [{
'name': 'Product ABC', // Full product name
'id': '123456', // Product SKU
'price': '15.25', // Price
'brand': 'Noname', // Brand of product
'category': 'Food', // Product category: Oil, Capsule, Flower or Accessory
'variant': '5g' // Size
}]
}
}
});
</script>
Since you're in a SPA, gtm.load and gtm.dom will only happen once, you need to base your triggers on something else.

Dynamic Actions for InfoBoxes with Bing Maps

I am creating a site that implements the Bing map control.
I have placed the pushpins, and they will show infoboxes when the user clicks on a pin.
What I need to do now is add actions to the infobox. I can do this statically with the action: option. I want to do it dynamically, as each site can have a different set of actions I want to present to the user.
I have built the string that has the actions in it, unfortunately the infobox wants an object, not a string, and I don't know which object it wants, nor how to turn the string into the proper object.
Any help at all would be appreciated.
Thanks!
Although you don't have a "setActions" you can use the "setOptions" on Infobox.
infobox.setOptions(infoboxOptions);
Ref: http://msdn.microsoft.com/en-us/library/gg675208.aspx
The options itself could be created like this, with just the actions:
var infoboxOptions = {
actions:[
{label: 'test1', eventHandler: testEvent1},
{label: 'test2', eventHandler: testEvent2}]};
Ref: http://msdn.microsoft.com/en-us/library/gg675210.aspx
You can call this anytime you want, thus adding for instance more actions to the infobox.
Now, you mention you have a string? I'm guessing you're talking about the JSON representation of the "infoboxOptions" or such. You can use something like
jQuery.parseJSON(jsonString); //if using jQuery
You can also do it programmatically, thus probably with some conditional logic:
var myActions = [];
if(A) {
myActions.push( {label: 'test1', eventHandler: testEvent1});
}
if(B) {
myActions.push( {label: 'test2', eventHandler: testEvent2});
}
if(C) {
myActions.push( {label: 'test3', eventHandler: testEvent3});
}
infobox.setOptions({ actions: myActions});

Ext.Direct Form Integration

I am using Ext.direct.RemotingProvider . At the server side I make some validation checks. The Respond is send back in JSON format.
If i find any errors when making validation checks, the field success = false, and errors will contain the error.
I am trying to figure out, how do i reflect errors i found in the server side in the form (client side).
In the link below there is an example of what i want to achieve. When the client press on "submit" an error message will occur in the form, how does it work ?
Example
In the code i post in the bottom the following happens:
in the browser there are 2 fields (Name,Email) and 2 buttons.
the fields are irrelevant for now. they are used as dummies.
Each time the user press on "Add" button, a new action is added into callBuffer of Ext.direct.RemotingProvider
When the user press on "Apply" button, all the actions are being sent to the router (MVC model) and from there to a specific controller. (the function sfw.Direct.getProvider('sfwProvider').combineAndSend() is triggered).
As for now, i intentionally fails the respond and create an error field, just like the example link i added in the beginning of the Thread.
i put in the errors field {email="Already exists"}.
but i see not effect in the form..
what am i doing wrong ?
Code:
appWiki.main_panel = new Ext.FormPanel({
renderTo: 'extjs_panels_container'
, id: 'appWiki_main_panel'
, name: 'appWiki_main_panel'
, defaultType: 'textfield'
, items: [
{
fieldLabel: 'Name',
name: 'name'
}
,{
fieldLabel: 'Email',
msgTarget: 'side',
name: 'email'
}]
,buttons:[
{xtype: 'sfw.Button'
, text: 'Add'
, handler: function(){sfw.rule.store.api.readByRowId({data: {_ROWID_: 1}});}
}
,{text: 'Submit'
, handler: function(){
appWiki.main_panel.getForm().submit({
});
}
}]
,api: {
// The server-side must mark the submit handler as a 'formHandler'
submit: sumbitAllRequests
}
, load: function()
{
setTimeout("hide_loading_mask()",2000);
}
});
In the JSON response you need the following structure
{ "result" : { "success": false, "errors": { "name of field" : "validation message" } }
Where "name of field" is the name config option in your field, and "validation message" is the message you want to display to the user.
When you send a response like that ExtJS will take care of the rest.
EDIT: You may also need to enable QuickTips:
Ext.QuickTips.init();
Add that line before you declare your form
EDIT 2: Also, make sure you're using the submit() method found on the BasicForm:
buttons:[{
text: 'Submit',
handler: function(){
basicInfo.getForm().submit({
params: {
foo: 'bar',
uid: 34
}
});
}
}],

Resources