Using profile scripts and the VEC

Ridder_M 09-05-2016


I setup the following profile script to match the birthday month of the person:

//get birthday month from both profile and current month
  var bday = profile.get('birthday');
  var dt = new Date();
  var mt = ("0" + (dt.getMonth() + 1)).slice(-2);

  // if both months are the same, return true
  if (bday == mt){
     return 'BirthdayGroup';
  // return false if the birthday month is different from current month
        return 'NonBirthdayGroup';

I used the above code to create an audience of visitors that are in the "Birthday Month".  I tried to create an Experience Targeting activity on the page, using the VEC to change the copy of the headline.  Unfortunately, it didn't work, but if I create the Experience Targeting activity using the Form-based Experience Composer, it works but it sticks the copy on the top of the page.  Is there anything that I need to do in the VEC, so the test works?  I really appreciate the help.



Accepted Solutions (1)

Accepted Solutions (1)

akashj80621328 10-05-2016

Hi Ridder,

I debugged your website implementation and found that you are explicitly creating target-global-mbox through mboxCreate() call. Global mbox is auto created and there is no need to explicitly make an mboxCreate call. To pass parameters to the mbox call we recommend you to use the targetPageParams() method as described in

Explicit mboxCreate() call might be over writing targeted content with default content on your page.

Let us know if this fixes the problem.



Answers (2)

Answers (2)

ParitMittal 10-05-2016

Hi Ridder,

The Profile script  seems to be perfectly ok and there should not have been any problem while creating the experience using VEC.  

However to further deep dive into problem and find the root cause it will be required for us to have access to Target Account  you are using to create the activity. Can you please provide your Target Account login Credentials in a private message.

Thanks & Regards

Parit Mittal