Untitled

mail@pastecode.io avatar
unknown
javascript
a month ago
714 B
12
Indexable
Never
<script>
 
document.addEventListener('DOMContentLoaded', (event) => {
let url = new URL(window.location.href);
 
let params = new URLSearchParams(url.search);
let utm_source = params.get('utm_source'); //vai ler o parametro da url
let utm_medium = params.get('utm_medium');
let utm_campaign = params.get('utm_campaign');
let utm_term = params.get('utm_term');
let utm_content = params.get('utm_content');
let utm_id = params.get('utm_id');
 
document.querySelector('input[name="website"]').value = utm_source + "; " + utm_medium + "; " + utm_campaign + "; " + utm_term + "; " + utm_content + "; " + utm_id;
 
document.querySelector('input[name="website"]').parentElement.style = "display: none;";
});
 
 
</script>
Leave a Comment