How to check if a string is a Google Click ID (GCLID) in PHP?

2.2k views Asked by At

This is a valid Google Click ID string:

CP7os5-UmcYCFasEwwodNIUA2A

This is also a valid Google Click ID string:

CjwKEAjw2ImsBRCnjq70n_amv14SJAChXijNyDh6_0YQL6aGJXdU6NsrseN9FSJomlqmSm4BNHqFBxoCZrvw_wcB

This is a random string, and probably this is not a valid Google Click ID string:

xjjdhdjskdjsdosidos43242342

Does anyone know how to detect if a string is a valid GCLID in PHP?

1

There are 1 answers

0
Abhinav On

I do not think it is possible to check if a string is a valid GCLID in PHP because it contains a timestamp, and two other different integers.

But you can certainly decode it using this useful function provided by this Blog here