Help with Target audience created from website behaviour | Community
Skip to main content
Level 4
September 10, 2025
Question

Help with Target audience created from website behaviour

  • September 10, 2025
  • 2 replies
  • 511 views

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.

2 replies

kandersen-1
Community Advisor
Community Advisor
September 11, 2025

@m_alcantara 

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

 

 

Test forum signature
Level 4
September 12, 2025

@kandersen-1 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.

kandersen-1
Community Advisor
Community Advisor
September 12, 2025

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?

Test forum signature