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.
It would be great to allow site admins to define variables directly in the GUI. Of course in most cases this would require token replacement so that they could (for example) include a "role" variable with the value being the role of the current user. This patch adds another fieldgroup to the Omniture settings form to allow this.
Comment | File | Size | Author |
---|---|---|---|
#11 | omniture-variables.patch | 8.36 KB | bleen |
#9 | omniture-variables.patch | 8.23 KB | bleen |
#8 | 1791670.patch | 7.03 KB | bleen |
#4 | 1791670.patch | 7.03 KB | bleen |
#1 | omniture-vars.patch | 6.89 KB | bleen |
Comments
Comment #1
bleen CreditAttribution: bleen commentedThere was a minor typo in the text of the "Add another variable" button in the original patch
Comment #2
gregglesI definitely see the benefit of this feature - thanks for adding it.
It would be interesting to performance test this feature just to make sure it doesn't cause a problem. If it does then maybe this should be in a sub-module or disable-able somehow.
Comment #3
bleen CreditAttribution: bleen commentedBelow are some quick AB results:
> ab -n 1000 -kc 10 http://d7:8888/foo/bar/baz
It seems that this patch (not unsuprisingly) has no effect when no variables are added and it has very little performance impact on 95% of requests when there are variables. That last 5% though might take a hit.
I'm not sure where the tipping point might be so I'd love some feedback there.
That all said, I did notice one area where this needs work and that is when the "omniture basic" module is enabled. In that case, there are now two field groups named "variables" which is clearly not good. This can be solved by renaming the new variables fieldgroup to "custom variables" or something like that.
Thoughts?
--------------------------------------------------------------------------------
***** WITH THE PATCH (adding 0 variables) *****
Percentage of the requests served within a certain time (ms)
50% 191
66% 210
75% 225
80% 233
90% 249
95% 264
98% 277
99% 293
100% 317 (longest request)
***** WITH THE PATCH (adding ~10 variables where 5 use tokens) *****
Percentage of the requests served within a certain time (ms)
50% 211
66% 229
75% 244
80% 254
90% 274
95% 288
98% 305
99% 515
100% 538 (longest request)
***** WITHOUT THE PATCH *****
Percentage of the requests served within a certain time (ms)
50% 201
66% 217
75% 231
80% 241
90% 262
95% 279
98% 292
99% 299
100% 315 (longest request)
Comment #4
bleen CreditAttribution: bleen commentedThis patch names the new field group "Custom Variables" ... it also creates an _omniture_get_token_context() function so that other token functionality can be included elsewhere (ex: #1815866: Add token support for code snippets. ).
The AB test results have nt changed from #3
Comment #5
gregglesThanks for running those tests, bleen18! I'm not sure why the second test takes so long at the very end. What was your standard deviation on the tests?
Comment #6
bleen CreditAttribution: bleen commented********** With Patch (10 vars with 5 tokens) ************
********** Without the patch ************
... setting to needs work as I found another weird issue with the table not being themed properly when omniture_basic is enabled
Comment #7
bleen CreditAttribution: bleen commentedTurns out the weird theme issue was some stale cache data
Comment #8
bleen CreditAttribution: bleen commentedthe same as #4 with "variable" spelled correctly everywhere.
Comment #9
bleen CreditAttribution: bleen commentedThis patch just does some cleanup...
Comment #10
bleen CreditAttribution: bleen commentedI'd like to go ahead and commit this and given that only 2% of requests seem to see any performance difference I think we should be good to go. My reasoning is basically that there should be some sort of performance hit when using tokens and the more you use the worse it will be. That isn't really unexpected. A user can obviously choose not to use token replacements and they are not effected in that case at all.
Any final thoughts?
Comment #11
bleen CreditAttribution: bleen commentedThis is a re-roll of the patch in #9
Comment #12
gregglesI think go for it, the performance concerns are gone in my mind. Thanks for doing that!
Comment #13
lucascaro CreditAttribution: lucascaro commentedHey guys, this is a great patch, I've tested it and so far it works great. I think that using tokens adds a ton of flexibility and is exactly what this module needs :)
Comment #14
bleen CreditAttribution: bleen commentedAwesome!! Thanks for the review @lucascaro.
Committed: http://drupalcode.org/project/omniture.git/commit/7fad8ebf9fc5a09239f7e2...
Comment #15
bleen CreditAttribution: bleen commentedComment #16
bleen CreditAttribution: bleen commented@lucascaro ... feel free to give the patch at #1223462: Omniture Context intergation a review for even more awesomer flexibility
Comment #17
lucascaro CreditAttribution: lucascaro commenteddone :)