On our webpage, there's a page with a button that downloads a PDF when clicked. I need to create two audiences:
1) Audience 1-visitors who went to the page but did not click the Download PDF button
2) Audience 2-visitors who went to the page clicked the Download PDF button
Audience 1 works. There's an issue with Audience 2. We use Web SDK.
I needed a way to detect button clicks on the page. There is only a single PDF on that page.
In Launch, I built a rule that fires when the Download PDF button is clicked. That rule is firing; it was verified using the Chrome console.
When the rule files, the action is this script.
<script>
console.log('Data collection: download button was clicked');
adobe.target.trackEvent({
mbox: 'downloadClickMbox',
params: {
clickedButton: 'downloadPDF'
}
});
</script>
In Target, I built a profile script to catch instances of the Download PDF clicks from Launch using this code.
Profile script name: 2025_Downloaded_PDF
if (mbox.name == "downloadClickMbox") {
return mbox.param("clickedButton") == "downloadPDF";
}
Finally, I made an audience from the profile script.
Attributes
Visitor Profile: user.2025_Downloaded_PDF Equals (case insensitive) downloadPDF
The Activity is not activated. To test, I toggle on: Match audience rules to see experiences
I open a browser tab and go to the Activity Link URL, which is the homepage of the site.
Then, I navigate to the webpage. I click on the Download PDF button.
I navigate back to the homepage. I should see the modifications but I don't.
Views
Replies
Total Likes
I'm not entirely sure what the main cause is, but i see some discrepancies in what you're describing.
You say you use WebSDK, but adobe.target.trackEvent is an at.js function - do you have both implemented?
If you in your trackEvent passed it as a profile parameter, you could skip the profile script and simplify the setup.
I also believe that your current profile script act as a boolean so it returns true or false - which means that your audience logic is wrong.
I hope this can help guide you in the right location for fixing this.
Let me know how it goes!
Regards,
Kasper
Views
Replies
Total Likes
@kandersen I'm sorry, I put the wrong script in my original post. We are using Web SDK. This is the action in the rule in Launch.
<script>
console.log('Data collection: download button was clicked');
alloy("sendEvent", {
xdm: {
eventType: "download.click",
web: {
webInteraction: {
name: "downloadPDF",
type: "click"
}
}
},
data: {
__adobe: {
target: {
mboxNames: ["downloadClickMbox"]
}
}
}
});
</script>
The Profile Scirpt in my original post is what I have, I confirmed it.
Views
Replies
Total Likes
I still think your profile script is returning true/false, but your segment logic is not looking for true/false
Visitor Profile: user.2025_Downloaded_PDF Equals (case insensitive) downloadPDF
Can you confirm your profile script is returning as you expect or try and update your segment logic?
Views
Replies
Total Likes
@kandersen , I made a lot of changes.
In Launch, the Rule was always firing so it's not the issue. However, I changed the Action. It's now using Extension: Adobe Experience Platform Web SDK extension>Action type: Send event.
Under Type, I entered "web.webinteraction.event34". Under XDM, I entered our schema variable.
The Rule fires when I click on the Download PDF button, as it should. In the developer console, I see sendEvent with Type: web.webinteraction.event34.
In Target, I changed the Audience to this:
Attributes
(Custom: web.webinteraction.event34 Parameter is present OR Custom: web.webinteraction.event34 Parameter value is present)
That parameter is not in the drop-down, I had to add it. I suspect this isn't right. The sendEvent is getting generated from Launch but it seems like it's not making it to Target or something is still not right with the Launch rule.
Views
Replies
Total Likes