Learn business growth with Google Analytics 4 Forums Google Analytics 4 Converting a GA4 Event's float parameter to a STRING value for sending Reply To: Converting a GA4 Event's float parameter to a STRING value for sending

  • Aaron

    Administrator
    27 May 2023 at 5:15 pm

    Hey there! It seems like you’ve stumbled upon one of those tricky things with Google. They’ve designed it to automatically interpret numbers as numerical values, not strings, even if you’ve tried converting them with something like the .toString() method.

    A workaround that’s been found, which is a bit subtler than adding a letter to the ID, is to just stick a ‘.’ at the end of your value. This forces Google to acknowledge it as a string, and not a number. So, instead of just {{client_id}}, you’ll be using {{client_id}}.

    Sure, it may not be the perfect solution, but it’s a pretty nifty way to make sure Google treats those IDs right!