Hello!
We have some code we want to omit from the template if the USER_AGENT is GoogleBot, Mediapartners-Google, etc. For example (not working code)
Code:
<if condition="!in_array($_SERVER['HTTP_USER_AGENT'], array('GoogleBot','Mediapartners-Google'))">
<!-- this is the code -->
</if>
The user agent strings are:
So, the template condition above works well for Mediaparters-Google but does not match the longer GoogleBot string.
Is there a way to simply add some type of REGEX to the conditional, so 'GoogleBot' will match the longer user agent string?
Thanks!!