• Resolved Cita Perfecta

    (@citaperfecta)


    Hi,
    One of the problems I have with AMP in my site is not being able to display different content depending on the visitors country.
    Does your plugin support the amp-geo function? If so, how can I use it?

    thanks so much!

Viewing 1 replies (of 1 total)
  • @citaperfecta You can use the amp-geo component as described on the components documentation.

    To add the component script to your site you can add the following to your active themes functions.php, or preferably a custom plugin so it doesn’t get overwritten:

    add_filter('amp_post_template_data', function( $data ) {
        $data['amp_component_scripts'] = array_merge(
        $data['amp_component_scripts'],
         array(
          'amp-geo' => true,
         )
        );
      return $data;
      }
    );

    After including the script you can add any of the example code using that resource as a reference.

Viewing 1 replies (of 1 total)

The topic ‘Geotargeting?’ is closed to new replies.