• Home
  • Get help
  • Ask a question

Reduced schedule during conference and annual break

We'll be operating with a reduced schedule from tomorrow and the next few weeks, as follows:

We'll be travelling and attending JoomlaDay USA from Tuesday April 22 to Friday April 25. Support will have extended response time during this period. From April 25 evening to Tuesday May 12 included, support will be closed for our annual break.

Don't forget to look up the documentation, including the videos, your answer may already be there! Likewise, be sure to check the Development versions area, in case your problem may already have been solved.

In case of emergency (ie your site is down with a fatal error directly linked to one of our extensions), please contact us by email (see contact icon at the bottom of all pages of this site)

#8854 – 4SEO - Cookie Promo Codes URLs and 4SEO page titles and descriptions

Posted in ‘4SEO’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Tuesday, 21 June 2022 13:47 UTC
tomaszciti

Hi

We create a custom cookie to store a promo code on our site (in development now; being upgraded from J3 to J4; working on a new template). 

issues:

URL example - "home" page: https://ccj4.lan?m=PROMO
URL example - "normal" page: https://ccj4.lan/card-replacement?m=PROMO

1) page title is not like the one set in 4SEO, it defaults to the one set in Joomla Configuration
2) page description is not like the one set in 4SEO, it defaults to the one set in Joomla Configuration
3) same applies to the following meta tags "twitter::title",  "twitter::description", "og:title", "og:description"

Similar problem was with SH404SEF - ticket #1047, which was resolved years ago.
What we had to do (well, still do in production) is edit '/administrator/components/com_sh404sef/configuration/configuration.php' and around line 29 add "m" to parameters list ie:

    private $_trackingVars = array('utm_source', 'utm_medium', 'utm_term', 'utm_content', 'utm_id', 'utm_campaign', 'gclid', 'fbclid', 'fb_xd_bust',
                                   'fb_xd_fragment', 'hitcount', 'm');


We also had to disable "Remote configuration". This fixed it for "normal" pages and shortly after you improved home detection so all was resolved. See the old ticket for details if needed.

How do we fix it in 4SEO?

Thanks.

Tuesday, 21 June 2022 14:51 UTC
wb_weeblr

Hi,

For these unusual tracking vars, you should use a filter. 4SEO already removes many of them, from large suppliers but you can change the list as you see fit using the forseo_config filter:

- Open the file /libraries/weeblr/forseo_functions.php (or create it if it does not exist - it should exist)

- Make sure the following is present at the top of the file:

<?php
/**
 * 4SEO hooks file
 *
 * You can use 2 variables to access 4SEO content:
 *
 * $factory: access variables
 * $hooks: add handlers
 */

use Weeblr\Wblib\V__DEV__\Wb;

// no direct access
defined('WBLIB_EXEC') || die;

- Paste the following code at the end of the file:

$hooks->add(
	'forseo_config',
	function ($config, $scope) {

		if ('app' === $scope)
		{
			$config['commonTrackingVars'] = array_merge(
				$config['commonTrackingVars'],
				[
					'm'
				]
			);

		}

		return $config;
	}
);

- Reset the analysis and restart it

- in case of trouble, just rename that file to anything else, for instance forseo_functions-disabled.php, and it will stop having any effect.

The filters defined in the forseo_functions.php are not modified when you update 4SEO, they'll always stay there. If you add more tracking vars in the future, you can add more them here as well.

Many things are customizable through filters in 4SEO, here is the list of hooks on the 4SEO documentation.

Best regards

Yannick Gaultier

weeblr.com / @weeblr

 

 

 
Tuesday, 21 June 2022 15:30 UTC
tomaszciti

Hi

Thanks. /libraries/weeblr/forseo_functions.php did not exist so we created it and pasted the code. All seems working. Will report if there are any issues.  

This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.