Forum Discussion
Ken_Chan_95249
Nimbostratus
Jan 07, 2010Add google analytics code to payload
Hi all,
I want to add the google analytics code to payload by irules and I have created the following ..
when HTTP_RESPONSE {
set clen [HTTP::header Content-Length]
HTTP::collect $clen
}
when HTTP_REQUEST_DATA {
set google_code " "
regsub -all "" [HTTP::payload] $google_code new_payload
HTTP::payload replace 0 $clen $new_payload
}
but it seems not working, does any one has any idea about that ? thank you in advance ..
- hoolio
Cirrostratus
Hi Ken,if {[HTTP::header "Content-Length"] contains "text" && \ [HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
- The_Bhattman
Nimbostratus
Hi Ken, - Madiw_114772
Nimbostratus
Just for people that would need that in the future, I used HTTP_RESPONSE_DATA instead of HTTP_REQUEST_DATA For the testing on the content, I used if {[HTTP::header "Content-Type"] contains "text" && [HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects