Expand my Community achievements bar.

SOLVED

Send props by data collection not work

Avatar

Level 1

Hello everyone, everything good?

I'm trying to send information through the data collection.
This information is a prop that should tell me if it's true or false.

In the data collection I created a rule with "Core - Direct Call" event and in the actions I pointed to my prop2, I also created a "Data Elements" called "marketing":

img1.png

And in that same rule I put the following custom code:

img2_js.png

and here is my data element:

img3_element.png
When firing from the browser console I see that it sends the information:

send_console.png
But unfortunately this information does not arrive on the adobe dashboard.
Can anyone tell me what is wrong with this implementation?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You're doing it wrongly.

If you're able to set the prop/eVar/event/etc using the form in the "Set Variables" action, like what you've done in the first screenshot, then that's all you need. You don't need to set any custom code at all.

If you want to set it with custom code, though, then well, your code is wrong. It should be like this:

s.prop2 = _satellite.getVar('marketing');  // this sets your prop2 variable with the value returned by the "marketing" data element

s.linkTrackVars = 'prop2';
// ideally, you shouldn't set linkTrackVars like this, just in case linkTrackVars had already been set with some other value in another rule or action
// so the below is actually better:
s.linkTrackVars = s.apl(s.linkTrackVars, 'prop2');
// now, you'll also need to add the "apl" plugin, available from the Common Analytics Plugins extension
// if you don't want to use that extension, then the following works too:
if (s.linkTrackVars) {
s.linkTrackVars = [s.linkTrackVars, 'prop2'].join(',');
} else {
s.linkTrackVars = 'prop2';
} // finally, you don't need to set linkTrackEvents since you're not setting any success events

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

You're doing it wrongly.

If you're able to set the prop/eVar/event/etc using the form in the "Set Variables" action, like what you've done in the first screenshot, then that's all you need. You don't need to set any custom code at all.

If you want to set it with custom code, though, then well, your code is wrong. It should be like this:

s.prop2 = _satellite.getVar('marketing');  // this sets your prop2 variable with the value returned by the "marketing" data element

s.linkTrackVars = 'prop2';
// ideally, you shouldn't set linkTrackVars like this, just in case linkTrackVars had already been set with some other value in another rule or action
// so the below is actually better:
s.linkTrackVars = s.apl(s.linkTrackVars, 'prop2');
// now, you'll also need to add the "apl" plugin, available from the Common Analytics Plugins extension
// if you don't want to use that extension, then the following works too:
if (s.linkTrackVars) {
s.linkTrackVars = [s.linkTrackVars, 'prop2'].join(',');
} else {
s.linkTrackVars = 'prop2';
} // finally, you don't need to set linkTrackEvents since you're not setting any success events

Avatar

Level 1

Thank you very much for the answer and for the clarification, I did a test now with a console.log(s.prop2) and it brought the value I sent to adobe.

img_console2.png

 

But this information still hasn't arrived on the dashboard, would you have any more configuration to do on the dashboard to present this result?

dash.png

Avatar

Community Advisor

Hmm, why is the "prop2" value being set as the boolean value true? Have you implemented this properly? Is your "marketing" data element really supposed to return that boolean value?

Please share the updated screenshots of your setup to help in troubleshooting.

Avatar

Level 1

Hi! It is a boolean, it will serve to inform us if the user has accepted or not to receive marketing contacts.

screenshots:

Data Element:

data_element.png

Rule:

rule.png

Event Direct Call:

event_rule.png

Actions rule:

action_rule.png

Custom code:

code_custom_rule.png

Send event:

send_rule.png

 

If you need more information or screenshots just let me know.

Thanks.

Avatar

Community Advisor

Firstly, as I had mentioned in my earlier reply, if you're setting any prop/eVar/event with the Set Variables form, then you don't need custom code. So you can take out that custom code, because it's redundant.

Secondly, you should change the boolean value to a string value. AA generally only accepts string values in props/eVars. A quick fix is to do the following:

  1. Add the Mapping Table extension to your Launch property.
  2. Create a data element from that extension to map your "marketing" data element to strings "true" and "false" appropriately (or "yes" and "no", if you like).
  3. Use that data element created in step 2 with your prop2.