Optimizing the Zango Gateway

The Zango gateway by default is limited in customizability to visual attributes. By default the gateway is displayed to every visitor, on every page they view. While customizing the look of the gateway can boost your conversion rate, many of us need more control, such as to display the gateway only once per visitor or only after a certain number of page views. The following PHP code does just that, it makes the Zango gateway display only once per visitor.
  1. <?php
  2.  
  3. //Increment the ‘views’ session variable.
  4. if (isset($_SESSION[‘views’])){
  5.     $_SESSION[‘views’] = $_SESSION[‘views’]+ 1;
  6. } else {
  7.     $_SESSION[‘views’] = 1;
  8. }
  9.  
  10. //Display Zango on only the first page view.
  11. if ($_SESSION[‘views’] == 1){
  12.     echo ‘***zango code here***’;
  13. }
  14. ?>
In case you didn’t know, a session is an encrypted cookie. What the first half of the code does is increment a session variable to count each visitor’s page views. The second half of the code starting with if ($_SESSION['views'] == 1){ checks if the visitor has viewed 1 page and if so, outputs the Zango gateway code.

If you want to modify the above code you would simply change the == 1 to == 3 for the third page view or > 3 for the 4th, 5th, 6th etc page views.

The reasons you may want to choose when the gateway will be displayed could be one of the following reasons; to make the gateway less annoying by making it display only once, or to have it display after the visitor has already had a taste of your content.

Displaying the gateway only once will help to reduce your bounce rate and increase the amount of return visitors. Having the gateway display after x amount of page views can increase the conversion rate on some sites.

1 Comment

Leave a Reply