Skip Navigation

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 4 replies, has 2 voices.

Last updated by alejandroG-25 4 years ago.

Assisted by: Bruno.

Author Posts
March 19, 2020 at 10:37 am #5718737

alejandroG-25

Tell us what you are trying to do?
I am trying to follow the steps indicated in the ticket: https://wpml.org/forums/topic/google-tag-manager-and-wpml-for-multiple-domains/ in order to install in the header.php archive a Google Tag Manager pixel for each of my domains (sportmadness.es, .fr, .mx, .uy, .pe, .pt, .in). As you may see, it is a multiple domain website and I want a different GTM pixel for each domain.

Is there any documentation that you are following? https://wpml.org/forums/topic/google-tag-manager-and-wpml-for-multiple-domains/

I have tried to follow the indications in the ticket, adding that php function in my site's <head> and my <body>, where I already have a singular GTM pixel, but the archive detects a syntaxis error before updating: syntax error, unexpected 'if' (T_IF), expecting ':'

Is there a similar example that we can see? Video of the error: hidden link

What is the link to your site? hidden link

March 19, 2020 at 10:52 pm #5723857

Bruno

Thank you for contacting us. By the error message, it is showing that the error is on line 31. What is in line 31? Please, using pastebin.com, could you post the complete header.php file?

Thank you.

March 20, 2020 at 9:15 am #5726415

alejandroG-25

Here you are!

https://pastebin.com/Qi97JJFL

Thank you Bruno

March 20, 2020 at 7:26 pm #5730445

Bruno

Hi,

Thank you. I believe that in the old PHP version accepted the separate "else if", but now it is necessary to use the "elseif". For example:

<?php if( ICL_LANGUAGE_CODE == 'es' ): ?>
<!--  english -->
<?php elseif( ICL_LANGUAGE_CODE == 'fr' ): ?>
<!--  french -->
<?php else: ?>
<!--  others -->
<?php endif; ?>

Try to make these changes and see if the problem still persists.

Thank you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.