warbie_136205
Mar 23, 2016Nimbostratus
Google Analytics different code for Multiple Sites
Hi All,
I am trying to figure out how to make different Google Analytic codes work for multiple sites. I found this on the good old interewebz/DevCentral listed below. However, when I create a second iRule and change out the gacode for another code I still see one GA code dominate both sites. I see now that Rule_INIT is a global call and I'm just not sure how to switch it up to make this work. Could any of you awesome people help me here? I've tried messing with streams to change it out and also thinking maybe my answer might be in the client_accept call, but I'm just kind of green here. Thanks in advance.
Code
when RULE_INIT {
set ::find ""
set gacode "UA-Code-x"
set ::replace " "
}
when HTTP_RESPONSE {
STREAM::disable
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression "@$::find@$::replace@"
STREAM::enable
}
}