• Home
  • Get help
  • Ask a question
Last post 2 hours 50 min ago
Posts last week 128
Average response time last week 28 min
All time posts 70381
All time tickets 10863
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#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.