Catching utm mark



  • I've got to get the utm tag along with the

    <input type="hidden" name="utm_source" value="<?php echo $_GET['utm_source'];?>">
    <input type="hidden" name="utm_medium" value="<?php echo $_GET['utm_medium'];?>">
    <input type="hidden" name="utm_campaign" value="<?php echo $_GET['utm_campaign'];?>">
    <input type="hidden" name="utm_term" value="<?php echo $_GET['utm_term'];?>">
    <input type="hidden" name="utm_content" value="<?php echo $_GET['utm_content'];?>">
    

    Tell me right, can you do that for js?



  • Better.

    <input type="hidden" name="utm_source" value="<?php echo isset($_GET['utm_source']) ? $_GET['utm_source'] : '' ;?>">
    

    In your code, if there's no query, it'll make a mistake Undefined index utm_source, etc.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2