This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 3 voices.

Last updated by jeroenV-58 8 months, 1 week ago.

Assigned support staff: Marcel.

Author Posts
September 22, 2019 at 8:08 am #4617629

raymondL-8

I am trying to:Setting up google tag manager on the woocommerce site using "Google Tag Manager" plugin but chrome extension doesnt seem to pick up any tags

Link to a page where the issue can be seen:Google Tag manager doesnt capture any tags.

I expected to see:The chrome extension capturing the tag information after pressing the "Enable" button

Instead, I got: But i am not getting any tag information

I am looking at this but dont know where to put this code. https://wpml.org/forums/topic/using-google-tag-manager-on-multiple-domains/

September 23, 2019 at 8:23 am #4621557

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Thank you for contacting WPML Support. This code needed to be added to the Header of your Theme. In your installed Flatsome Theme this is located at header.php File.

Best Marcel

March 21, 2020 at 9:05 pm #5734109

jeroenV-58

GTM is added in header.php (the Head tag) and there is also a GTM part in the body of the HTML (at the beginning of the body).
Please instruct very detailed how to implement this code given before. Also tell what items to change. Would be of great help...

<!-- ANALYTICS TRACKING CODE -->
<?php
// DA language
if ( defined( 'ICL_LANGUAGE_CODE' ) && 'da' == ICL_LANGUAGE_CODE ) {
//Just for debug, you can remove this input later
echo('<input type="hidden" value="language active: DA">'); ?>

<!-- Content for DA language here -->

<?php }
// DE language
else if ( defined( 'ICL_LANGUAGE_CODE' ) && 'de' == ICL_LANGUAGE_CODE ) {
//Just for debug, you can remove this input later
echo('<input type="hidden" value="language active: DE">'); ?>

<!-- Content for DE language here -->

<?php }
// SV language
else if ( defined( 'ICL_LANGUAGE_CODE' ) && 'sv' == ICL_LANGUAGE_CODE ) {
//Just for debug, you can remove this input later
echo('<input type="hidden" value="language active: SV">'); ?>

<!-- Content for SV language here -->

<?php }
// EN language
else if ( defined( 'ICL_LANGUAGE_CODE' ) && 'en' == ICL_LANGUAGE_CODE ) {
//Just for debug, you can remove this input later
echo('<input type="hidden" value="language active: EN">'); ?>

<!-- Content for EN language here -->

<?php }
// NO language
else if ( defined( 'ICL_LANGUAGE_CODE' ) && 'no' == ICL_LANGUAGE_CODE ) {
//Just for debug, you can remove this input later
echo('<input type="hidden" value="language active: NO">'); ?>

<!-- Content for NO language here -->

<?php }
// Just for debug, you can remove this
else {
echo('Something is wrong');
}
?>
<!--/ ANALYTICS TRACKING CODE -->