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":
And in that same rule I put the following custom code:
and here is my data element:
When firing from the browser console I see that it sends the information:
But unfortunately this information does not arrive on the adobe dashboard.
Can anyone tell me what is wrong with this implementation?
Solved! Go to Solution.
Views
Replies
Total Likes
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
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
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.
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?
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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:
Rule:
Event Direct Call:
Actions rule:
Custom code:
Send event:
If you need more information or screenshots just let me know.
Thanks.
Views
Replies
Total Likes
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:
Views
Replies
Total Likes
Thank you very much, I will do that.
Views
Replies
Total Likes
Views
Likes
Replies