Hi
I am new to adobe target, trying to write a profile script for a use case.
The use case is like, if user searches by ticked a check box then promote an offer related to the ticked checkbox.
For this i am trying to set a profile attribute when some ticked the checkbox and create a profile script by reade this profile attribute.
Create an audience using this profile script and target an offer.
I didn't fine anywhere how to set a profile attribute in my html page and how to read the attribute value in profile script.
Any help will be much appreciated.
for this use case : 'if user searches by ticked a check box then promote an offer related to the ticked checkbox."
Step 1. First identify the tick event and in the eventlistener function like click, fire a Dynamic mBox with value relevant to checkbox (which makes sense to you)
(Then ensure dynamic mBox is firing properly on page. This can be checked in Network tab in developer's tool )
Step 2. Then create a profile script and check for the set value of dynamic mBox here and return true when value is what you have set for the checkbox click event.
Step 3. Then Create an audience and use the above profile script where you are validating the dynamic mBox value which you are firing on click of checkbox with the necessary parameters.
Step 4. Use this audience in Target activity.
Hope this helps :-)
@skandg thanks for your suggestion.
I tried to create a dynamic mbox as advised by you and the mbox is not triggering
var test="";
if ($('#my_id').is(':checked')) {
test= "B";
mboxDefine('my_id,'my_dynamic_mbox,
'test=B’);
mboxUpdate('my_dynamic_mbox, 'test=B’);
}
Hi
mbox is to be defined around a DIV element. You may refer below document to create a dynamic mbox
Also below document can be referred for functions being used with at.js
Rather than using mboxDefine/mboxUpdate I'd recommend you use the adobe.target.trackEvent function (only works for at.js). Tanvi linked to a help doc with some details on it. Here is a simple sample though:
You can pass the parameter as a "profile.param1" if you want it to be sticky for the visitor. However, in your use case where you have a profile script looking for attribute you probably don't need to use the "profile." because the profile scripts are sticky too.
As I mentioned before, inside your click event function write code as per below sample:
btn_Click_function(){ // this is your button click function
//Place below code
adobe.target.trackEvent({
"mbox": "Checkbox", //define the mBox name here,
"params": {
"profile.checkBoxTicked":true //set the parameter as profile and assign value as 'true'
}
});
}
Hope this helps !
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies
Views
Like
Replies