Is there a way to add conditional activation for activities? | Community
Skip to main content
billc52928879
September 14, 2017

Is there a way to add conditional activation for activities?

  • September 14, 2017
  • 1 reply
  • 16593 views

Let's say I only wanted to run an activities on pages where a certain DOM element exists (and there's no URL pattern that could be used for the "Page Delivery") - is there any way in Target to use a custom script to activate the activity?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Amelia_Waliany
Adobe Employee
Adobe Employee
September 18, 2017

Greetings, thanks for your question! For a VEC-based Activity, you need a URL to import the Activity. To learn more about whether it is possible to override the URL here, visit Visual Experience Composer Best Practices and Limitations. If the same DOM element ID is used on multiple elements on the page, changing one of those elements changes all elements with that ID. To prevent this from happening, an ID should be used only once on each page. This is a standard HTML best practice; for more information, see Page Modification Scenarios. For a Form-based Activity, you can use a custom script to run the Activity - just make sure to include the mboxCreate on the page.

aellis82
Level 2
April 10, 2018

Hello,

this question very much relates to our problem, but the response does not solve our problem and we'd really appreciate some help.

We're new to target and would help with setting up conditional activation of an A/B experiment.

We only wish to include visitors in the experiment when there are less than 3 instances of a particular div element on the page.

We can count the elements using $('.x').length where x is a class.

However we are unclear on how to target users for this particular scenario only. Currently, everyone who visits the page is included in the experiment, regardless of how many of this particular element are present and this isn't what we need.

Please help.

thanks,

Andrew

siddharthjainPM
Adobe Employee
Adobe Employee
April 13, 2018

Hi Andrew

So, these elements are dynamic? Some see 1, others see 2 or 3?

I would say that it might be a good option to see if something can be added in URL parameters based on the same business logic which is changing these element counts. Is that not doable?

Can you explain your use case bit more? What are these divs an?