- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
08-09-2013 08:17 AM
Solved! Go to Solution.
08-09-2013 08:36 AM
08-09-2013 08:37 AM - last edited on 10-08-2015 12:24 PM by kathleen_jo
Hi Roshan,
In the custom container you can make use of the data object. This can be called from within the send function. By using the data object you make use of the mapping UI within the tag.
For example:
/*Transmission Code Stubs Here - a:eventType, b:eventData, data:mappedData*/
redirecting2_tracksale(data.cID,data.order_id);
This will allow you to manually map cID and order_id to a data source in the UI.
08-09-2013 08:39 AM - last edited on 10-08-2015 12:26 PM by kathleen_jo
To add to Simon
Within the Tealium Custom Container template, you can use the syntax:
data[variable]
where variable gets replaced with the parameter to receive the "action" value.
So if you want to pass to an "action" parameter then in your instance you should use:
data[action]
within your script to capture this value.
Cheers,
-Dan
08-09-2013 08:50 AM - last edited on 10-08-2015 12:26 PM by kathleen_jo
Hi Roshan,
If you want a good example, take a look at the VCCP custom container I did for you, as that makes extensive use of the mapping facility.
Craig.
08-09-2013 08:53 AM - last edited on 10-08-2015 12:27 PM by kathleen_jo
Thanks everyone, the problem I'm having is that I'm trying to refer to the data object within the area you enter you tags:
/* Start Custom tag*/
/* End custom tag */
Any idea how I refer to it in there? I tried the VCCP tag but that's all done within the u.send function.
08-09-2013 08:54 AM
08-09-2013 09:04 AM - last edited on 10-08-2015 12:30 PM by kathleen_jo
The solution I use for this is to create a function in the /*Start Custom tag*/ area, and call that function from the send function. As an example, this would go in the send function:
...
/*Transmission Code Stubs Here - a:eventType, b:eventData, data:mappedData*/
}
my_function(data);
};
And this would go in the /*Start Custom tag*/ section:
/*Start Custom tag*/
var my_function = function (x){
var my_mapped_variable = x["some_mapped_variable"];
}
You can put whatever code you need to in the my_function variable, and reference the mapped values using the notation above.
08-09-2013 09:11 AM
08-09-2013 09:18 AM
08-13-2013 12:53 AM - last edited on 10-08-2015 12:32 PM by kathleen_jo
Hi all,
Thanks for your help. I ended up pasting my code and referring to the 'data' object in the u.send function (instead of bothering with code in the custom code area). I then mapped the variables in the tealium console and it all works.
Link: http://jsfiddle.net/sBUgt/
Cheers!
Copyright All Rights Reserved © 2008-2023