• Resolved kiandept

    (@kiandept)


    Hej guys,

    the Geo My Wp Plugin integration is not working for Geo My Wp 4.0 beta. So I followed the instructions to set up an integration for Complianz. I get a working placeholder. But its not shown in the integration overview and users cannot select the service on the gdpr settings page.

    Geo My Wp 4.0
    Complianz 6.5.2
    WordPress 6.2.2

    plugins > geo-my-wp > complianz.php

    defined( 'ABSPATH' ) or die ( "you do not have access to this page!" );

    chield theme > functions.php

    /**
    * Insert an integration
    * @param array $cmplz_integrations_list
    *
    * @return mixed
    */
    function my_plugin_integration($cmplz_integrations_list){
    	$cmplz_integrations_list['GeoMyWp' ] = array(
    		  'constant_or_function' => 'GMW_VERSION',
    		  'label'                => 'Geo My WP KB for WordPress',
    		  'firstparty_marketing' => true,
    	);
    	return $cmplz_integrations_list;
      }
      add_filter( 'cmplz_integrations', 'my_plugin_integration');
      
      /**
      * @param string $path
      * @param string $plugin
      *
      * @return string
      */
      function my_plugin_integration_path($path, $plugin){
    	if ( $plugin === 'GeoMyWp' ) {
    	   return 'wp-content/plugins/geo-my-wp/complianz.php';
    	}
    	return $path;
      }
      add_filter( 'cmplz_integration_path', 'my_plugin_integration_path', 10, 2 );
      
      
      /**
      * Add a script to the blocked list
      * @param array $tags
      *
      * @return array
      */
      function cmplz_geomywp_script( $tags ) {
    	  $tags[] = array(
    		 'name' => 'GeoMyWp',
    		 'category' => 'marketing',
    		 'urls' => array(
    			   'geo-my-wp/assets/js/',
    		 ),
    		 'enable_placeholder' => '1',
    		 'placeholder' => 'openstreetmaps',
    		 'placeholder_class' => 'gmw-ajax-form-container',
    		 'enable_dependency' => '0',
    	);
    	
    	  return $tags;
    	}
    	add_filter( 'cmplz_known_script_tags', 'cmplz_geomywp_script' );

    About help I would be very happy.

    Kind regards,
    Kian

    • This topic was modified 1 year, 3 months ago by kiandept.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor jarnovos

    (@jarnovos)

    Hi @kiandept,

    While the current integration does seem to work out of the box for me (with BETA 5 of the Geo My WP plugin), you can achieve the described behavior like this:

    Use the following code in /wp-content/plugins/geo-my-wp/complianz.php:

    <?php 
    
    defined( 'ABSPATH' ) or die ( "you do not have access to this page!" );
    
    /**
      * Add a script to the blocked list
      * @param array $tags
      *
      * @return array
      */
    function cmplz_geomywp_script( $tags ) {
    	$tags[] = array(
    		'name' => 'google-maps',
    		'category' => 'marketing',
    		'service' => 'google-maps',
    		'urls' => array(
    			'geo-my-wp/assets/js/',
    		),
    		'enable_placeholder' => '1',
    		'placeholder' => 'google-maps',
    		'placeholder_class' => 'gmw-ajax-form-container',
    		//'placeholder_class' => 'gmw-map-loader',
    		'enable_dependency' => '0',
    	);
    
    	return $tags;
    }
    add_filter( 'cmplz_known_script_tags', 'cmplz_geomywp_script' );
    
    /**
     * Add services to the list of detected items, so it will get set as default, and will be added to the notice about it
     *
     * @param $services
     *
     * @return array
     */
    
    function cmplz_geomywp_detected_services( $services ) {
    
    	if ( ! in_array( 'google-maps', $services ) ) {
    		$services[] = 'google-maps';
    	}
    
    	return $services;
    }
    add_filter( 'cmplz_detected_services', 'cmplz_geomywp_detected_services' );

    And instead of adding your code in functions.php, please use the following snippet and place it in /wp-content/mu-plugins/geo-my-wp.php instead.

    <?php
    defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
    
    /**
     * Insert an integration
     * 
     * @param array $cmplz_integrations_list
     * @return mixed
     */
    function my_plugin_integration( $cmplz_integrations_list ) {
        $cmplz_integrations_list['geo-my-wp'] = array(
            'constant_or_function' => 'GMW_VERSION',
            'label'                => 'Geo My WP KB for WordPress',
            'firstparty_marketing' => false,
        );
    
        return $cmplz_integrations_list;
    }
    add_filter( 'cmplz_integrations', 'my_plugin_integration' );
    
    /**
     * @param string $path
     * @param string $plugin
     * @return string
     */
    function my_plugin_integration_path( $path, $plugin ) {
        if ( $plugin === 'geo-my-wp' ) {
            return ABSPATH . 'wp-content/plugins/geo-my-wp/complianz.php';
        }
        return $path;
    }
    add_filter( 'cmplz_integration_path', 'my_plugin_integration_path', 10, 2 );

    This will add the integration toggle under Complianz -> Integrations -> Plugins, and allow for (de)activation of the map via the Google Maps checkbox on the Cookie Policy.

    Kind regards, Jarno

    Thread Starter kiandept

    (@kiandept)

    Hej Jarno,

    thanks for your fast reply!!! It works so far, thx! But I don`t use Google Maps – is it possible to integrate OpenStreetMap as a clickable single service? I’ve replaced “google-maps” with “openstreetmaps”. While OpenStreetMap is recognized in the Complianz settings, it does not appear as a standalone service on the GDPR settings page. Could this be because OSM uses cookies? Would it be necessary for me to install the Leaflet or OSM plugin?

    In addition, despite agreeing to the cookies, the code is blocked so that the info window on the map is no longer displayed when clicking on the map marker. Otherwise the Ajax form works as it should. Only when the manual implementation of Geo My WP KB is deactivated (as shown in screenshot 1), do the info windows on the map become available again (as demonstrated in screenshot 2).

    About help I would be very happy.

    Kind regards,
    Kian

    • This reply was modified 1 year, 3 months ago by kiandept.
    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @kiandept,

    Note that I hadn’t changed your integration itself (i.e. the blocked scripts and dependencies) but only ensured that it appears under the Integrations section in the back-end & linked it to the Google Maps service. I don’t have the Pro version of this Map plugin (which is required for the info windows), so I can’t test that implementation myself yet.

    In any case, you can indeed link this to OpenStreetMaps instead by replacing all instances of google-maps with openstreetmaps in the code.

    You would then have to perform the following steps for the service to appear on the Cookie Policy with a consent checkbox:

    • Run a Cookie Scan (Wizard -> Consent -> Cookie Scan) and make sure that “gmw_” cookies are detected (such as gmw_autolocate)
    • Under Wizard -> Consent -> Cookie Descriptions, click the “gmw_” cookies to expand them, and untick “Sync with Cookiedatabase”. Now attach these to the service OpenStreetMaps with a purpose such as Marketing/Tracking.
    • Save your changes, and Finish the Wizard. (Important: it may take a few hours after making these changes, before the OpenStreetMaps service appears with the checkbox on the Cookie Policy).

    And then you’ll end up with a result like this. When the service is consented to, it will accept the GMW Map.

    Kind regards, Jarno

    • This reply was modified 1 year, 3 months ago by jarnovos.
    Thread Starter kiandept

    (@kiandept)

    Hej @jarnovos,

    thanks for the quick help! Thanks for the precise instructions! I have implemented so far (screenshot 1). The placeholder is displayed with OpenStreetMap and also shows the consent option. On the gdpr settings page OpenStreetMap is displayed as a service, but the field to give consent is missing (screenshot 2).

    I will try to solve the problem with the map markers afterwards. I am already in contact with the colleagues from Geo My Wp. They are very interested in an implementation.

    About help I would be very happy.

    Kind regards,
    Kian

    • This reply was modified 1 year, 3 months ago by kiandept.
    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @kiandept,

    I’d just like to clarify that Complianz has integrated with GEO My WP for 2+ years already. When I created the test site at the start of this thread with their BETA 5 & the latest Complianz version, this still worked out-of-the-box.

    We’d be happy to get in touch with the developers of the plugin to ensure compatibility with their Pro plugin as well, as I suspect that this could be the difference here.

    Regarding the checkbox: this is where the last step of my previous post comes into play, which is to allow some time for this adjustment to be fully registered (these results are cached).

    As a result, the service is still seen as “Functional” as it was in the previous situation, so the checkbox does not appear yet.

    Kind regards, Jarno

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘New Version Geo My Wp 4.0 beta’ is closed to new replies.