Expand my Community achievements bar.

Applications for the 2024 Adobe Target Community Mentorship Program are open! Click to the right to learn more about participating as either an Aspirant, to professionally level up with a new Certification, or as a Mentor, to share your Adobe Target expertise and inspire through your leadership! Submit your application today.

profile attribute creation and reading profile attribute in profile script

Avatar

Adobe Champion

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.

5 Replies

Avatar

Employee

vengadeshs86143832​,

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 :-)

Avatar

Adobe Champion

@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’);

}

Avatar

Employee

Hi

mbox is to be defined around a DIV element. You may refer below document to create a dynamic mbox

Creating a Dynamic Mbox

Also below document can be referred for functions being used with at.js

at.js Functions

Avatar

Employee Advisor

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.

Avatar

Employee

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 !