I am having an issue deleting two google tags from my site.
PageSpeed Insights show that the following JS scripts continue to slow down speed and they are related to two tags I once installed but have since removed:
https://www.googletagmanager.com/gtag/js?id=G-9CX6BE0GKZ&l=dataLayer&cx=c
https://www.googletagmanager.com/gtag/js?id=G-JG99TNC089&l=dataLayer&cx=c
I believe I created these in GA and have deleted them (they are currently in the trash bin and still recoverable). I also deleted my GTM account and all the Google Tags associated with them.
The site is run with Wordpress and Rankmath enters the properties into the code. The issue doesn't seem to be Rankmath-specific since Site Kit for Google produces the same problem of the site continuing to call for these third-party resources.
Chrome Dev tells me that the following local_ga_js script is calling them: https://pandem-ic.com/?local_ga_js=7ba79e8aaaf79be6b38be456194551aa
And this file contains the following:
var data = {
"resource": {
"version":"1",
"macros":[{"function":"__e"},{"function":"__c","vtp_value":"undefined"}],
"tags":[{"function":"__rep","vtp_containerId":"UA-188331756-3","vtp_remoteConfig":["map"],"tag_id":1},{"function":"__zone","vtp_childContainers":["list",["map","publicId","G-9CX6BE0GKZ"],["map","publicId","G-JG99TNC089"]],"vtp_enableConfiguration":false,"tag_id":3}],
"predicates":[{"function":"_eq","arg0":["macro",0],"arg1":"gtm.js"}],
"rules":[[["if",0],["add",0,1]]]
},
"runtime":[]
You will see that UA-188331756-3 is the property I want to keep. The two other properties (G-9CX6BE0GKZ and G-JG99TNC089) are listed as child containers.
I am having difficulty figuring out what is triggering this and how to remove the two tags in question.
Any help most appreciated!
Related
For the following website that I have made: ifrs.site (WordPress site with custom theme, if that's important), there is an overlap of content by the footer when the browser window is not maximised on desktop, or when viewed on mobile. I fixed this overlap issue in the dev environment, but the live website with the same CSS code as the dev website ends up with a worse overlap.
What is the cause in discrepancy? You can see the differences in code at this github repo: https://github.com/keg504/IFRS-Website-theme-files, in the 2 branches dev-files and master. What is on master is what is used on the site currently.
I'm using Local by Flywheel for the dev environment on Windows 10, and the CSS is run using a webpack configuration on nodejs.
Edit: As Aliqua has requested, I've added the wp_enqueue_style function I'm calling to load the CSS: wp_enqueue_style('our-main-styles', get_theme_file_uri('/bundled-assets/styles.ba56d060f11656536bc3.css'));
The part between styles...css changes whenever npm run build is run in the command line
Depending on your design/setup the css could have attached in the source code a ?ver=1.0.0 or similar. Which means if you have made changes but not updated the version it is still recalling the original file from the cache.
Some developers overcome this by setting the enqueue_script() version part of the array to a date() (including time with hour-min-sec) function. This will mean that everytime the page is refreshed the version is different and it wont recall older versions of the css from the cache.
Search your code for the enqueue script line for the css in question and see if you can set date() to the version value.
Refer to https://www.php.net/manual/en/function.date.php for more information.
Update:
Based on your update, you could replace it with something like this.
wp_enqueue_style( 'our-main-styles',
get_theme_file_uri('/bundled-assets/styles.ba56d060f11656536bc3.css'),
array( $parent_style ), // remove if there is no parent style
date("His")
);
Reference wp_enqueue_style - https://developer.wordpress.org/reference/functions/wp_enqueue_style/
Final Thoughts:
Please note, that this answer may in fact not be the actual solution as much as I have tried to identify your issue. Please refer to https://developer.wordpress.org/ to familiarise yourself with the introductory information in relation to wordpress development. If you are going to want to do more changes to your wordpress CMS, you will need a basic understanding of how to make changes. Please focus some of your research to plugin creation, working with child themes, and how to make your own custom functions. Then you will be able to write better questions, and be able to action the answers in the future.
Best of luck with your development.
I have a tracking Iframe that is deployed through a custom HTML tag and triggered on the window loaded event.
The src attribute takes several custom JS variables to populate certain parameters where available.
However, in production the src attribute is full of errors that aren't showing up in preview mode. There are no issues with the variables themselves, as they have all been unit tested extensively.
Below are (1) the tag config for the iFrame's src attribute as shown within GTM, (2) the html produced in preview/debug mode, and (3) the html that's actually being produced in production:
​
src="//servedby.flashtalking.com/container/14745;109435;11282;iframe/?ftXRef={{TransID Availability Test - Onetag}}&ftXValue={{Revenue Availability Test - Onetag}}&ftXType=FTXTYPE_VALUE&ftXName=FTXNAME_VALUE&ftXNumItems=FTXNUMITEMS_VALUE&ftXCurrency=FTXCURRENCY_VALUE&U1=U1_VALUE{{dataLayer Stations Output - Onetag}}{{Journey Date Output - Onetag}}{{Journey Ticket Type Output - Onetag}}&U8=U8_VALUE&U9=U9_VALUE&U10=U10_VALUE&U11=U11_VALUE&U12=U12_VALUE&U13=U13_VALUE&U14=U14_VALUE&U15=U15_VALUE&U16=U16_VALUE&U17=U17_VALUE&U18=U18_VALUE&U19=U19_VALUE&U20=U20_VALUE&ft_referrer={{Encoded Page URL}}&ns={{Referrer}}&cb={{Random Number}}"
https://servedby.flashtalking.com/container/14745;109435;11282;iframe/?ftXRef=2526968585&ftXValue=1.2&ftXType=FTXTYPE_VALUE&ftXName=FTXNAME_VALUE&ftXNumItems=FTXNUMITEMS_VALUE&ftXCurrency=FTXCURRENCY_VALUE&U1=U1_VALUE%26U2%3DU2_VALUE%26U3%3DU3_VALUE%26U4%3D28%2F12%2F19%26U5%3D%26U6%3DSDS%26U7%3DU7_VALUE&U8=U8_VALUE&U9=U9_VALUE&U10=U10_VALUE&U11=U11_VALUE&U12=U12_VALUE&U13=U13_VALUE&U14=U14_VALUE&U15=U15_VALUE&U16=U16_VALUE&U17=U17_VALUE&U18=U18_VALUE&U19=U19_VALUE&U20=U20_VALUE&ft_referrer=https%253A%252F%252Fwww.domain.co.uk%252Fbuytickets%252Fpaymentconfirmation.aspx&ns=https%3A%2F%2Fwww.domain.co.uk%2Fbuytickets%2Fpaymentconfirmation.aspx&cb=126603136
https://servedby.flashtalking.com/container/438;87804;9034;iframe/?ftXRef=2526968585&ftXValue=1.2&U1=paymentconfirmation&U3=1&U4=01000&U7=28/12/19&U9=BIRMINGHAM%20NEW%20STREET&U10=BIRMINGHAM%20SNOW%20HILL&ft_referrer=https%3A//www.domain.co.uk/buytickets/paymentconfirmation.aspx&ns=https%3A//www.domain.co.uk/buytickets/paymentconfirmation.aspx&cb=473400.6608119874
​​As you can see, the section in (2) in bold/italics is being removed entirely in production, despite the fact that these parameters aren't configured to be populated or modified by any variables. Similarly, parameters U9 and U10 are being populated seemingly from nothing - they aren't set to be populated by any variables.
Those parameters that are configured to be populated by custom variables aren't working properly - the values shown in production are either absent or else don't match the results given either in debug/preview or in unit testing, which suggests the problem is with GTM itself.
Are you sure that these are the same tag? Looking at the top tag it starts
/container/14745;109435;11282
and the bottom tag starts
/container/438;87804;9034
To me, the tags seem so completely different that I don't believe they're the same. GTM may do many things, but it doesn't randomly change your code! I've never seen it remove variables, or add them in, or change strings, it wouldn't have the ability to. Custom HTML tags are literally written 'as is' into the GTM.js file, with the exception of variables being replaced with macros.
If you've recently updated the tag then other reasons you're not seeing the changes may be:
You're looking at a cached version of GTM, in which case empty your cache, refresh the page and that should sort it.
You're working in and previewing changes that haven't been published, so won't show on the live site; if you publish the changes that should work.
If neither of those work then it would be good if you could share a link to the site so I can investigate!
For my Jekyll-created web site, hosted on github, I'd like to use different CSS locally vs published.
Specifically, when I access it via http://localhost:4000/blah-blah, I'd like some extra page elements to be visible, and when I access it via http://mysite.github.io I want those extra elements to be invisible.
I want to add things like an "Edit Me" button to load the page with http://localhost:4000/admin.
I don't think I can do this with liquid, because the variables are processed at build-time, and I need different values at view-time.
How can I make my Jekyll-built site load different CSS based on the base URL (or hide/show page elements based on the base URL)?
You could do this with JavaScript. You could use document.domain to get the domain you are in.
var localsite = "localhost:4000/blah-blah";
var livesite = "mysite.github.io";
var domain = document.domain;
if(domain == localsite){
// display edit button
}
Something like that might work. I'm no expert at Jekyll (yet). There might be some code in jekyll that will help you do this differently and better. You may want to spend some time in the Jekyll docs first.
This issue started occurring today: the menu links stop working intermittently (I try clicking, and nothing happens) and I can only get them to start working again by doing a few refreshes. Then again, after moving around the menu a few times, the links stop working.
I noticed this problem on the localhost and then, to test it, I uploaded the website to a webspace and the problem is still there (also tried two different computers, clearing cache, etc.).
The test page is here: http://toulouse.xardas.lima-city.de/en/
I have deactivated several plugins and tried retracing my steps to see if anything I did today could have caused it (I mainly worked on changing the image sizes on the main page in CSS), but I couldn't find the cause.
I have tried the trick where you re-save the permalinks once with a new structure, and then change them back to what they were again and save. That didn't help.
I'm at a loss.
Your problem its not related to plugins, your website has 2 critical javascript errors that show up on the console and they seem to be disabling your website Javascript:
jquery.min.js is no able to load.
masonry.pkgd.js is not able to load.
Both errors are occurring because WordPress its trying to load them from a local server of yours (127.0.0.1).
Since your website its not on a local server, you need to change the tag that refers to those scripts and update the src to the real address of those libraries.
You can need to make sure that this script:
<script type="text/javascript" src="http://127.0.0.1/wordpress/wp-content/themes/elisabethzeigt-topmenu/js/jquery.min.js"></script>
Gets replaced with this:
<script src="http://toulouse.xardas.lima-city.de/wp-content/themes/elisabethzeigt-topmenu/js/jquery.min.js"></script>
The only thing that was updated was the initial part of the src: "http://toulouse.xardas.lima-city.de/" instead of "http://127.0.0.1/wordpress/".
Remember: You should to the same to the other script tag of the masonry library.
If you don't know how to replace them: just search for "jquery" and "masonry.pkgd.js" in your functions.php file and you will find the lines of code.
There is a chance that you functions.php has a global variable with the path to your website and you can fix the issue updating that variable instead of the scripts.
Basically the issue im having is I have a custom theme, and I need to use $scripts to call the analytics code at the top (the link tracking settings) however this also loads loads of other cr*p js files I dont need or want.
All I want is the analytics stuff the module places in $scripts.
So can I somehow either:
A) Load only the analytics code via $scripts (.info file?)
B) Create a new region in .info file (e.g. $analytics) and call that via the template. But then how do I get the analytics code to output to this new region instead of $scripts?
Any help would be most appreciated.
A.
I would be wary of not outputting $scripts. The files that are output are needed for your other modules to work properly. If you want to reduce the scripts which are output then turn off modules that you don't need.
I agree that disabling the $scripts variable (or cleaning it out) will have some "undesired results". I can think of about half a dozen modules that I use on every build that have required js files.
Maybe you should look into the Google Analytic Module which uses the $footer variable instead of the $scripts.
http://drupal.org/project/google_analytics
I also use this module on all my builds as it provides some very easy integration of Drupal into GA including downloads, user roles, etc. (out of the box)
p.s.
Remember Drupal has a pretty good Performance settings that allow for the cache as well as consolidation css/js.
My final builds have 1 line of markup that calls ALL of my css for that page and one line that does the same for my js. It's been shown that consolidating your asset files into one large file rather then many small ones is a huge performance saver, more so then the size of the end file itself.