Viewing 2 replies - 1 through 2 (of 2 total)
  • @rthaena I ended up creating some JavaScript to fix this issue for our client. I thought I would share it here incase anyone else is getting the same alert from Meta.

    <script type="text/javascript"> window.onload = function() { if (!window.location.href.includes("lat=") && !window.location.href.includes("lng=")) { // Paste your Facebook pixel code here and leave out the opening and closing script tags }; </script>

    Basically what this code does is checks the current page to see if the queries lat and lng are present. If they are, the pixel is not going to track the event, all other queries it will track per normal.


    • This reply was modified 1 year, 4 months ago by WP Codeus.
    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello @wpcodeus,

    Thank you so much for posting your solution.

    Below is another possible solution. A JavaScript that would remove the hidden lat and long fields from the search form so they won’t get populated in the URL at all:

    function gmw_custom_remove_hidden_coordinates() {
    	?>
    	<script>
    		jQuery( document ).ready( function() {
    			jQuery( '.gmw-submission-fields' ).find( '.gmw-lat, .gmw-lng' ).remove();
    		});
    	</script>
    	<?php
    }
    add_action( 'wp_footer', 'gmw_custom_remove_hidden_coordinates' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Lat/Long values in the query string’ is closed to new replies.