I’m looking to dynamically update the headings of products on my Shopify store based on a keyword extracted from a custom URL parameter. The custom URL is generated from Google Ads, and I want the script to read the keyword from a specific parameter (e.g., utm_content). I’ve tried the following JavaScript code, but it doesn’t seem to work. Could you please review the code and provide any insights or improvements? I tried this example code:
- The custom URL from Google Ads looks like: https://surebuy.shop/products/hydrogen-water-bottle-hydrogen-water-machine?utm_content=keyword1
- I want to extract the keyword (keyword1) from the utm_content parameter and append it to the product headings. And make this aply to all my product headings. So lets say Im selling a blue ball with the title being blue ball, I wan’t it to add the keyword to the tittle so it will be blue ball keyword1, in this case
Any assistance or suggestions would be greatly appreciated! Thank you.