Skip to main content

Hi,

We used the official Magento plugin via composer for about a year or so, but recently we're forced to stop using.

We followed instructions to disable and remove, and inside admin config area etc are gone.

However we still see a load of JavaScript on the front page.

Does anyone know how to remove this pls?

 

Thanks

Hi ​@danielpugh

 

Thanks for sharing this question with the Community! 

 

Are you able to go into the backend of your store’s script and see the Magento code? If so, you should be able to remove it. 

 

If not, I would reach out to the the Magento support team to confirm how to do this since they own the integration. 

 

Hope this helps! 

-Taylor 


Hi,

Thanks for the reply.

The JavaScript is added by the klaviyo module.

When the module is removed the JavaScript remains.

Unsure what you mean by the "backend of the stores script".  I have root admin and ssh access.  The script isn't evident in the filesystem so seems to be stored in the database somewhere as a block.  However it's not visible via the admin gui.

 

I would raise a support ticket with klaviyo, but this isn't possible without a subscription (ours has ended).

Hence asking here…

 

Dan


just to add to above in case anyone does know - im using magento 2.4.6p8

steps i have tried:

(1 - to install)

composer require klaviyo/magento2-extension
php bin/magento setup:upgrade

(2 - to uninstall)

bin/magento module:uninstall  Klaviyo_Reclaim --clear-static-content
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f en_US en_GB
php bin/magento cache:flush

 

i also tried disabling all functionality via the config section when installed prior to uninstall.

the remaining javascript i get starts like the below snippet… (where XXXX is our ID)

 

<script async type="text/javascript" src="//static.klaviyo.com/onsite/js/klaviyo.js?company_id=XXXX"></script><script>
    function initConfigurableOptions(productId, optionConfig) {

        function findPathParam(key) {
                        const baseUrl = (BASE_URL.substring(0, 2) === '//' ? 'http:' : '') + BASE_URL;
            const baseUrlParts = (new URL(baseUrl)).pathname.replace(/\/$/, '').split('/');
            const pathParts = window.location.pathname.split('/').slice(baseUrlParts.length + 3);
            for (let i = 0; i < pathParts.length; i += 2) {
                if (pathParts)i] === key && pathParts.length > i) {
                    return pathPartsii + 1];
                }
            }
        }

  ...

 

As mentioned i would raise a support ticket, but when logged in i get the message below:

 


Hi ​@Taylor Tarpley do you know an alternate way to get through to the Klaviyo magento module support team?  it would be really good to have this documented.  i have searched everywhere, and cannot find any further information on what do do.  Never had this level of difficulty/obscurity with other magento modules in the past.  Unsure why we are blocked from support assisting which obviously wouldnt be the case if we were on-boarding!


Hi ​@danielpugh

Here is a link I was able to find for their support (Magento is now Adobe Commerce): https://commercemarketplace.adobe.com/contacts. Hope that helps! 

~Chloe


Thanks ​@chloe.strange 

Unfortunately I already tried and got no reply in several weeks.

I also messaged the contact of the team on the Magento GitHub, with no reply from them either.

Seems like we would have to re-subscscribe @£400+ per month just to get un-installation support.

 

Not a great experience!

 

Happy Christmas to you though, and thanks!


Hello Danielpugh,

This is a reply to your first post!

It sounds like the JavaScript from the plugin wasn’t fully removed. Check if there are leftover files or scripts still loaded in your Magento theme (e.g., in head.phtml or custom layouts). Also, clear your Magento cache and static files:

Copy code

php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:static-content:deploy

If the issue persists, don’t hesitate to reach out as i’m always ready and  would be happy to help troubleshoot further.


Hi ​@MANSIR2094 ,

Yes I emailed the support email with no reply.

I have checked all files in the filesystem.  

When I do this the only location containing the references is in the auto-generated cache files.

I have run those commands many many times with no change

I suspected maybe a past Dev added the reference manually, so checked the obvious place in Magento Webgui (content-theme-html head) but nothing there

 

This is why in posts i mentioned theory it must be e.g. a block in the database added programmatically…

 

 


Hello Danielpugh,

Thanks for the update! It seems the JavaScript might have been added programmatically. You can check the database for references in the cms_block, cms_page, or layout_update tables. Also, inspect theme files or custom XML changes for scripts. Disabling custom modules or extensions temporarily can help identify if they are adding the script.

If you would like further assistance, feel free to reach out,  I would  be happy to help.
And let me know if this worked out!


Thanks ​@MANSIR2094  I'll start checking those tables after the break.

 

 I can't see why/that that third party modules will add the klaviyo JavaScript 

 

Also... It wasn't on our stage site until I added the klaviyo module.  Now have the same issue with that site....


Hello Danielpugh,

Thanks for the feedback! Since the issue appeared after adding the Klaviyo module, it’s likely the module added the JavaScript programmatically. Along with checking the database tables, also inspect the module’s files (e.g., etc/frontend.xml or layout files) for any references to the script.

If the issue persists, we could further debug the module or explore a clean reinstallation to ensure no leftover configurations. Let me know if you need support with this! 


Reply