Using UTM links in get condition?


(TT) #1

Hello,

We often use conditions based on parameters. e.g. type=student which works fine e.g. conditional keywords such as %globals_get_type% or %begin_globals_get_type^eq:student% etc.

However is there a way to use UTM parameters in there? I’m guessing the underscore is breaking it e.g. utm_campaign=clearing.

I’ve also tried setting it up using the conditionals screen but it doesn’t seem to work. Anyway to get around the underscore? The problem is quite a few of the campaign emails with the UTM links already in it have been sent out, so we can’t simply add a new parameter to the end of those links.

Cheers,

Tim

Matrix Version: 5.5.6.3


(David Schoen) #2

Squiz Edge and some other proxies will strip utm_* query parameters before forwarding the request to Matrix as a simple way to normalise the URL for cache purposes. This often means Matrix doesn’t see the utm parameter at all.

If this is the case you may be better off putting the conditional in ESI any way so that you can vary the HTML sent to the user while maintaining a single cache object e.g https://github.com/ledgetech/ledge#edge-side-includes


(TT) #3

Thanks David! I’ve not used ESI but it looks great. For some reason I still can’t get it work with UTM’s.

For example this works:

   <esi:choose>
  <esi:when test="$(QUERY_STRING{test_content}) == 'clearing'">
     True
  </esi:when>
  <esi:otherwise>
     <p>False</p>
  </esi:otherwise>
</esi:choose>

but this doesn’t:

   <esi:choose>
  <esi:when test="$(QUERY_STRING{utm_content}) == 'clearing'">
     True
  </esi:when>
  <esi:otherwise>
     <p>False</p>
  </esi:otherwise>
</esi:choose>

Which makes me think it’s stripping anything with utm like you said.

Cheers,
Tim