I am updating the site zone attribute value based on the current page path, using dart_tag_alter hook. THis was working perfectly except for the updates not being reflected in the noscript tag. Turns out that the noscript tag processing function is being fired just prior to dart_tag_alter hook:

Line 247 - dart.module (6.x-2.2)

    // Build data for the noscript tag.
    $tag->noscript = dart_tag_prepare_noscript($tag);  // <-- noscript tag is built

    // Give other modules the opportunity to add information to this tag.
        drupal_alter('dart_tag', $tag);  // <-- customization are performed on the $tag object

I'm not sure if this was intentional or not, but reversing the order of these operations fixes the issue.

    // Give other modules the opportunity to add information to this tag.
        drupal_alter('dart_tag', $tag);  // <-- customization are performed on the $tag object

    // Build data for the noscript tag.
    $tag->noscript = dart_tag_prepare_noscript($tag);  // <-- noscript tag is built

Comments

bleen’s picture

Version: 6.x-2.2 » 6.x-2.x-dev

I gave this a bit of thought... which is more important the ability to alter the entire tag object (including the noscript) or the ability to have the keyvals in the noscript tag match the keyvals for the script tag...

I think your right though ... the keyvals need to match.

This fix (from the OP) has been committed to dev

davmorr’s picture

Ah, I see your point. Yeah, I think it is important to keep the script and noscript ad calls consistent - advertisers are a fickle lot. I'm a big fan of exposing as much as possible without compromising performance, core functionality or security.

bleen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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