Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm working on a project, which only has a handful (~10) of different creatives, which I've setup as DFP Tags with blocks. It seems that the way the module currently works, that in order to configure proper targeting with tokens, that I'd have to either:
- Create and manage multiple DFP tags, just to include the right tokens per Drupal entity (This is not ideal from a maintenance and bloat perspective. If I only need 10 different tags, I'd rather not maintain 30-60+ tag instances and their placement, just to get proper targeting params.)
- Create a custom module and alter each block to handle the targeting there (This is an option, but it's also a maintenance issue because there is an admin UI exposed, and doing this in code will disconnect from that UI.)
- Create a more flexible UI to apply global targeting parameters (Hence, this issue.)
I think that D8 Pathauto module improvements are fantastic, and its Patterns UI is perfect for the use case of applying global targeting parameters here. Here's a screenshot of that UI:
In place of the "Pattern" column, we could simply include a list (possibly trimmed) of targeting params and values.
Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#25 | interdiff.txt | 6.24 KB | dawehner |
#25 | 2768625-25.patch | 53.61 KB | dawehner |
#22 | interdiff.txt | 11.45 KB | dawehner |
#22 | 2768625-22.patch | 49.31 KB | dawehner |
#20 | interdiff.txt | 842 bytes | dawehner |
Comments
Comment #2
JacineComment #3
dawehnerI'm going to give it a try, and if its just to keep @jacine sort of sane.
Comment #4
dawehnerHere is some initial work, which just covers the UI so far.
Comment #5
dawehnerIts not really pathauto but it still uses the condition api.
Comment #7
dawehnerThis is too fast. I cannot handle that.
Comment #8
alexpottCould do with docs.
This is a targeting thing right - not a Tag? Also I think this is a bit weird to require the user to come up with the machine name and not allow them to get descriptive.
Missing docs.
Docs
Should do this at the end - saves a query if not needed.
I think it is a bit friendlier to anything that is customising this module to add this new param at the end.
Comment #9
dawehnerThank you for your review alex!
Thank you
Comment #10
JacineHi! Should I test this as is, or wait for changes?
Comment #11
dawehnerDamnit, I just forgot to upload a patch.
Comment #12
JacineIt works! Thank you so much. It's really nice to see this come together. I have some nitpicks, and some issues, that hopefully can be resolved easily.
Global settings
/admin/structure/dfp/settings
I think the "Global targeting" section that shows here should be moved to the "List Targeting" tab (which we should rename - see below). I think it could either be provided as a "global" targeting set provided by the DFP module by default, or even just printed at the top of this page.
List Targeting
/admin/structure/dfp_ads/targeting
Add DFP Targeting
/admin/structure/dfp_ads/targeting/add
Let me know if I can explain this further, or if anything sounds crazy/weird?
Comment #13
JacineI take this back upon discussing further. Using the standardized contextual filter is better. We'll just need to work in support for taxonomy terms.
Comment #14
dawehnerGreat idea! I would ask @alexpott here though, whether this belongs into this issue, or whether this cleanup should be done separately.
Comment #15
JacineUp to you guys. As long as it all works, I guess it could be moved to follow-up.
Critical piece still missing here:
Major stuff:
The rest could be considered minor.
Comment #16
dawehnerWorking on it.
Comment #17
dawehnerNote: Actually we have an option for taxonomy terms: Its hidden behind "vocabulary", because well, this is what the condition is about. Its about the vocabularies of terms.
Changes of this patch:
see screenshot:
Comment #18
dawehner.
Comment #20
dawehnerHere is a quick fix
Comment #22
dawehnerThis patch now takes into account cacheability metadata.
Comment #23
dawehnerNote: This requires #2847334: ContextAwarePluginBase should implement CacheableDependencyInterface to really work.
Comment #25
dawehnerNow targets could be defined in multiple places. They have to be merged to not be overridden on the ads site.
Comment #26
bleen CreditAttribution: bleen at NBCUniversal commentedhere testbot