Google Analytics code on all pages, not just detail

This topic contains 4 replies, has 3 voices, and was last updated by  Gaspare Marturano 4 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #519798

    Gaspare Marturano
    Full Member
    Post count: 7

    Hello, is it possible to restrict display of GA code on pages? if so, how do I restrict GA code to only listing detail pages?
    Thank you.

    #519801

    Alex Rollin
    Moderator
    Post count: 27815

    I will ask the developers to take a look at your question.

    #519804

    Gaspare Marturano
    Full Member
    Post count: 7

    Thank you.

    #519923

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Gaspare,

    you can use below code snippet to show ga only on listing detail page

    
    <?php 
    function gd_show_ga_code() {
        if( geodir_is_page('detail') ):?>
                // ga code 
                <script>
                    // ga code
                </script>
        <?php endif;
    }
    add_action('wp_head', 'gd_show_ga_code');
    #519982

    Gaspare Marturano
    Full Member
    Post count: 7

    Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount