Tealium - Lookup Tables based on jQuery onHandler - google-analytics

I would like to setup Google Analytics event tags based on the jQuery onHandler. I would like to use a lookup table with the jQuery as the key and push the GA event parameters as the value. Only issue is that I don't know how to set the jQuery as the lookup value.
Any suggestions?

If you are using Tealium then the way this would be done is with two extensions. The first one would set a new variable to the value obtained with jQuery, the second one would be the lookup table that would utilize the same variable in the "Lookup Value In" field. If both extensions are scoped the same then the jQuery extension will need to be placed above the lookup table so it will run first.
Here is an example of the two extensions you could set up:
This first one sets a new variable (new_var) to a value when you mousedown on the selected element. This can be changed to however you want to populate your data.
jQuery Extension setting new_var to a value
This next extension is the lookup table where your lookup value is the new_var that you just populated, and the destination is the variable that you will map into your tag.
Lookup Table extension

Related

How to dynamically track the the values of form fields?

I want to track the field values after submitting a form in gtm. I tried creating dataLayer variable, like
"gtm.element.3.value". But here '3' which is the index value of an input field is static. I want it dynamic so that I don't have to create multiple variables. Do we have to create multiple dataLayer variables of each index value, like gtm.element.0.value, gtm.element.1.value, gtm.element.2.value, etc. ?
Basically I want to make this process dynamic instead of adding the index value statically. Is it possible in GTM?
That completely depends on the format in which your form values are pushed to the dataLayer. Normally, we would ask front-end to push meaningfully named values to the DL to then use in GTM.
From where you're at, you can just make one custom JS variable and parse your elements as you wish, adding the dynamicity you require. In production, however, it's not a good practice to hack things like that. If they add or remove a field in your form, the indexes will shift and your data will suddenly change without notice. This can easily lead to wrong conclusions on the data consumption side.

Showing all the possible values of a field in App Maker dropdown

I need to create a filter which gets all the possible values for a concrete field, but I'm only getting the values which appears in the current page.
Result
What can I do to get all the values?
It looks like you want to filter table basing on value in the dropdown. In order to do this you need to bind your dropdown's value to datasource's filter:
#datasources.MyData.query.filters.Country._equals
then you need to reload your datasource every time when user changes dropdown's value
// onValueEdit
app.datasources.MyData.load();
You can play with this sample app to learn more: https://developers.google.com/appmaker/samples/project-list/

Google Tag Manager - Grab nested value from data layer

I want to grab the price key in the addToCart datalayer. It does not work by simply creating a price variable - I get the value Undefined. How do I grab a key that is nested this deep?
https://s22.postimg.org/f7g95zrk1/Screen_Shot_2016_11_05_at_14_09_00.png
Create new variable with this value:
ecommerce.products.0.price
You need to use dot notation to access nested dimension.
inserted this as a variable and just referenced the datavariable name in GTM.
ecommerce.add.products.0.price

Count of the icon tab filter

I would really like to understand how to use the "count" property of the IconTabFilter for SAPUI5 to dynamically show the count of the result set of a table.
I have the following code -
<IconTabFilter
count="{DataSet/$count}">
<Table items="{DataSet}">
But the count is not filled automatically.
I am using an oData model that is bound on the view level. I do not want to make another backend request just for the counts. What am I doing wrong here? Is there a different mechanism that can be used?
I also tried using the updateFinished event on the table to then get the count and set it via JS but the event is triggered only on DOM placement of the table. In my case the table is hidden behind the IconTab and is not placed into the DOM till the first time the user clicks the tab so its useless.
Really would appreciate some insight into how to use this!
Thanks!
Okay, so what I did was I bound my information to a local model and did an oData $expand query to fetch the entire pages information in one call.
This worked out for me because I had several sets of data to be fetched. Before they were bound individually to tables, now they are all in one query.
In the .done() method of the call I just used the setCount method of the IconTabFilter to set the count as per the return data set.

Checkboxes and View Based Table View

I am having some difficulty trying to use checkboxes as the selectedIndex in a view based table.
There is good documentation on view based table here:
[View Based Tables ]
However, I after searching and looking on Stackoverflow I can't seem to get my implementation for doing the following.
My view is a table that makes a callout to Yahoo Finance. The table is view based constructed with bindings.
When the table is populated I want to have a check box against each row so that when the user clicks the check box, that row will be updated from Yahoo. Currently this works using multi or single selection using the table view and an observer.. I want to do this with the checkboxes and a button that gets all the checked rows.
The IB setup is as follows:
What is the best way to get the rows where the checkbox is selected? Should I use the array controller or do I need to do something with the table?
Assuming that you use a NSArray of NSDictionaries as your data model, why not add a key/value pair to each "stock" dictionary as a flag? Then in your button action method, just iterate through the data model and trigger an update when the flag is set. Bindings do the rest!

Resources