Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function getUrlParameter(name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
- var results = regex.exec(location.search);
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, " "));
- }
- var adoricUtm = {
- utm_source: getUrlParameter('utm_source'),
- utm_medium: getUrlParameter('utm_medium'),
- utm_campaign: getUrlParameter('utm_campaign'),
- utm_term: getUrlParameter('utm_term'),
- utm_content: getUrlParameter('utm_contente'),
- campid: getUrlParameter('campid'),
- adsetid: getUrlParameter('adsetid'),
- adid: getUrlParameter('adid'),
- lm_supplier: getUrlParameter('lm_supplier'),
- isEmpty: true
- }
- for(key in adoricUtm) {
- if (key !== 'isEmpty' && adoricUtm[key].length > 0) {
- adoricUtm.isEmpty = false;
- }
- }
- if (!adoricUtm.isEmpty) {
- adoricUtm.URL = window.location.href;
- window.localStorage.setItem('adoricUtm', JSON.stringify(adoricUtm));
- }
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement