Javascript outdated

Created on 29 August 2017, almost 7 years ago
Updated 23 July 2023, 11 months ago

When trying to use the dfp module, the scripts generated by the Twig templates are no longer valid with the DFP platform.

I had to make a number of changes to get it working including:
- Rearranging external library injection to match official DFP generated tags
- Slot calls are being made to googletag directly instead of adding to the 'cmd' array queue
- An unknown array attribute 'slots' is added to googletag global and slot definitions are added to this, but this doesn't appear required by the API and is throwing errors
- Minor code standards like indentation, making sure ensuing script tags run on defer as DFP API doesn't appear to have an onready() type event

If I could also make a suggestion too - the admin 'Global DFP settings' screen should be updated based on the current DFP dashboard. It's not clear what a 'Network ID' is as this terminology is not used by Google (anymore, if previous).

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡΄Colombia jedihe

    Updating to apply on top of πŸ“Œ Automated Drupal 10 compatibility fixes Fixed - #7 πŸ“Œ Automated Drupal 10 compatibility fixes Fixed .

  • πŸ‡¨πŸ‡΄Colombia jedihe

    In case it helps somebody: here's a set of patches to considerably improve DFP:

    {
        "extra": {
            "patches": {
                "drupal/dfp": {
                    "D10 compatibility": "https://www.drupal.org/files/issues/2023-04-13/3296953-dfp-d10-7.patch",
                    "Support sync/async switching": "https://www.drupal.org/files/issues/2023-04-14/dfp-outdated-js-2905298-24--for-3296953-7.patch",
                    "Lazy-loading support": "https://www.drupal.org/files/issues/2021-05-21/3179558-dfp-lazyload-8--for-2905298-17.patch",
                    "Support out-of-page slots": "https://www.drupal.org/files/issues/2022-05-16/dfp-out-of-page-support-2905255-16.patch",
                    "Add slot_id token": "https://www.drupal.org/files/issues/2020-02-25/dfp-slot-id-token-3116037-2.patch",
                    "Add token browser": "https://www.drupal.org/files/issues/2021-05-21/dfp-add-token-browser-2905038-9.patch",
                    "Multiple ads per ad slot": "https://www.drupal.org/files/issues/2022-05-16/dfp-multiple-ads-per-slot-3116576-9--for-2905298-22--2905255-16.patch",
                    "Output JS slot definitions in proper order": "https://www.drupal.org/files/issues/2023-04-14/2837056-dfp-slot-js-definitions-reversed-9.patch"
                }   
            }
        }
    }
    

    DFP 1.2 + this patches currently pass tests both for D9.5 and D10.

  • Status changed to Fixed 11 months ago
  • πŸ‡¦πŸ‡ΊAustralia VladimirAus Brisbane, Australia

    Thank you! Committed! 🍻

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024