HandL UTM Grabber: Capture UTMs on your forms
This page is dedicated to HandL UTM Grabber and its documentation. Please comment down below if you have any question or future requests about the plugin.
Major features in HandL UTM Grabber include:
- Add hidden fields in your forms (incl. Contact Form 7, Gravity Form)
- Pass UTM variables to major marketing tools such as ActiveCampaign, Vero, Aweber, Interspire and many more…
- Hassle free implementation (no shortcodes). See below…
I – Installation of HandL UTM Grabber
It installs like every other simple plugins out there. So, no specific information needed in this section.
II – What can you do?
Capture all the UTM variables as soon as user hits your website (ANY page of your WP installation): One great feature of the plugin is the UTM variables are saved in client’s browser and even though there is no UTM variables in URL, the variables can still be accessible via shortcode across any page/widget of your website.
III – How to use?
1. WP’s native shortcodes
[utm_campaign] – Prints out utm_campaign variable.
[utm_source] – Prints out utm_source variable.
[utm_term] – Prints out utm_term variable.
[utm_medium] – Prints out utm_medium variable.
[utm_content] – Prints out utm_content variable.
[gclid] – Prints out gclid variable.
[handl_original_ref] – The URL from which the user came to your site
[handl_landing_page] – The very first page the user visited on your site.
[handl_ip] – The IP address of the user.
[handl_ref] – The URL which the user came from to the page you have the shortcode.
[handl_url] – The URL on which you placed the shortcode.
2. Input Field Wrapper
There are some places you are not able to use WP’s native shortcodes. One example is when you use HTML in WYSWYG editor. If you directly copy paste the HTML below in your WP editor, you will see that the shortcode breaks.
<input type="hidden" name="utm_campaign" id="utm_campaign" value="[utm_campaign]" />
In order to prevent this, we recommend using the following shortcode wrappers.
[[utm_campaign_i]<input type="hidden" name="utm_campaign" value="%s" />[/utm_campaign_i]] [[utm_source_i]<input type="hidden" name="utm_source" value="%s" />[/utm_source_i]] [[utm_term_i]<input type="hidden" name="utm_term" value="%s" />[/utm_term_i]] [[utm_medium_i]<input type="hidden" name="utm_medium" value="%s" />[/utm_medium_i]] [[utm_content_i]<input type="hidden" name="utm_content" value="%s" />[/utm_content_i]] [[gclid_i]<input type="hidden" name="gclid" value="%s" />[/gclid_i]] [[handl_original_ref_i]<input type="hidden" name="handl_original_ref" value="%s" />[/handl_original_ref_i]] [[handl_landing_page_i]<input type="hidden" name="handl_landing_page" value="%s" />[/handl_landing_page_i]] [[handl_ip_i]<input type="hidden" name="handl_ip" value="%s" />[/handl_ip_i]] [[handl_ref_i]<input type="hidden" name="handl_ref" value="%s" />[/handl_ref_i]] [[handl_url_i]<input type="hidden" name="handl_url" value="%s" />[/handl_url_i]]
You can safely use the shortcode wrappers in your HTML content without worrying about breaking the code.
3. Hassle Free Implementation (No Shortcode)
Upon ativation of this plugin, it will fill the elements named “utm_source, utm_medium, utm_term, utm_content, utm_campaign, gclid” AUTOMAGICALLY! (by element name, id and class)
Simple Examples:
<input type="hidden" name="utm_campaign" /> <input type="hidden" name="foo" id="utm_campaign" /> <input type="hidden" name="foo" class="utm_campaign" />
If you are already using one of those names either in your form element name, id, or class. You do not have to use the shortcode or shortcode weappers. HandL UTM Grabber will automatically fill the corresponding fields. Easy peasy eh?
When to use?
1. if you would like to pass UTM variables to another domain. You can simply append UTM variables into your destination URL like this
<a href="www.destinationURL.com?utm_campaign=[[utm_campaign]]&amp;utm_source=[[utm_source]]&amp;utm_term=[[utm_term]]&amp;utm_content=[[utm_content]]&amp;gclid=[[gclid]]">Click Here To Go >>> </a>
2. Submit UTM variables into your favorite email marketing tools (Lead Tracking)
Very detailed information and integration tutorials with major marketing tools (ActiveCampaign, Vero, Aweber) and other WP plugins (Contact Form 7, Gravity Forms, WordPress-to-lead for Salesforce CRM, Ninja Forms) can be found here
A few typos in the new documentation. Consider changing from:
[handl_original_ref_i][/handl_original_ref_i]
[handl_landing_page_i][/handl_landing_page_i]
[handl_ip_i][/handl_ip_i]
[handl_ref_i][/handl_ref_i]
[handl_url_i][/handl_url_i]
to:
[handl_original_ref_i][/handl_original_ref_i]
[handl_landing_page_i][/handl_landing_page_i]
[handl_zip_i][/handl_zip_i]
[handl_ref_i][/handl_ref_i]
[handl_url_i][/handl_url_i]
All the field names are currently “gclid”
Thanks Nathan!
I have fixed it…
Hope you are using the plugin without any problem…
Hello, first of all thank you very much for the plugin.
I work with gravity forms.
I have put the hidden field and it can be filled dynamically.
In parameter I have put [gclid] and the field appears in white … what have I done wrong?
Thank you so much
Can you share the link you are testing the plugin with?
Hi! We have used your plugin for years and appreciate it greatly. In the last week or two it has started pulling in old UTM values. Even if a user visits the site on a direct URL (without any UTM on it) – the form hidden fields are getting populated because the plugin is finding old UTM values from previous sessions or visits. I did a test myself and it is definitely pulling in old UTM stuff. Do you know how and why it would have started doing this? We are using Version: 2.7.19 of the plugin.
This sounds like caching related, do you mind sending me the URL? If you can join or Slack channel, maybe we can communicate quicker https://www.haktansuren.com/slack-handlwp/
Thanks – i’ve shot you a direct in Slack 🙂
My previous comment was stripped of its code 🙁
Hi,
Does this plugin store the utm details in cookies?
Or will it only work when the URL features the various UTM parameter.
Hi Lawrence,
Yes it stores the UTMs in COOKIEs as soon as they are available in the URL. So when user submits the form, it can pass the UTMs even though the UTMs are not in the URL
Awesome 🙂
The issue I have now is that the form I am embedding necessarily needs its own value for ‘name’.
So I can’t have name=”utm_campaign”
Are you using Contact Form 7? Please also check this post where several different implementations were shown http://www.haktansuren.com/handl-utm-grabber-integrations/
how can i use it as its not showing me edit option after instaallation?http://prntscr.com/hge0xf
I did not recognize the plugin on your screenshot. Are sure you are using HandL UTM Grabber?
Will the UTM be passed if I have my domain and subdomain on a different server?
http://Www.testing.com (serverA)
App.testing.com (serverB)
Hi Lim,
Very good question. I personally have not tested this but according to this, it should work.
I need to pass the UTM throughout the site and when they click on an outbound link, can this plugin pass the UTM in the URL throughout the site?
Yes, this plugin exactly does what you are asking…
First of all, as soon as you installed the plugin, all the utm variables will be “automatically” recorded in the cookie.
Simply use this in order to pass the UTMs
Also check #1 of “WHEN TO USE?” section of this article…
Let us know if you need any other help!
So in order to pass the UTM throughout the site, I have to add the shortcode to all my links? Great plugin by the way!
Yes…
Btw, I have another solution (another plugin [not in WP plugins yet though]) that automatically appends UTMs to all the URLs on your website. Let me know if you would be interested in that. I can send you the link or maybe include it in this plugin as a feature.
Yes! That would be great, because I have menu items etc that I don’t want to go through and add that link to. Thank you very much!
Thanks again, let me know when you can send that to me, I am looking to get it implemented asap. Basically there will be different users coming into the site with different UTM’s and I just need to ensure that their specific UTM get’s carried throughout the entire site, and on outbound links that goes to our app. I believe with some tweaks this plugin is exactly what I need. Again, great plugin!
Hello, thank you very much for this really useful plugin.
Btw… I’m also interested in the plugin which will allow me to automatically appends UTMs to all the URLs on my website.
Would be great if I could get it.
Thanks in advance.
Thank you for the feedback, Yasser. I am currently working on implementing that feature. I think I will release the new version of the plugin within a week or so.
Happy to announce that I have just released a new version v2.5 that auto appends UTM variables to all links. Update HandL UTM Grabber plugin to the latest to activate the new feature.
Hello, i have a problem adding the passed utm parameters to a standard menu entry.
the entry is an individual link to a webapplication on a different server. plugin is installed and the passed url on the webapp is:
https://mypagelink/?utm_campaign=%5Butm_campaign%5D&utm_source=%5Butm_source%5D&utm_medium=%5Butm_medium%5D#/auth/login
if I enable the setting to pass the utm parameter to all links the correct values are appended on my menu link, but thats not an option for me, i have to specifiy the locations where i pass the original utm parameters.
Is there anything different if i add it in the wordpress default menu individual link part?
Let me understand it right… You want to append UTMs to menu items only?
Yes so to say. I want to choose the outgoing sources where the utm parameters are appended.
It works perfectly on other content elements, but on a menu item i cannot add these.
i made a workaround and use now a custom javascript which appends the parameters to specific elements with a defined class
Do you use a plugin for creating the menu element (e.g. Uber Menu)? Append UTM is still in beta, it is still not compatible with some of the plugins.
Not only, but additionally to other ways which are already supported.
For example i have an outgoing link in the menu to our Webapp my.bikersos.com and i want to pass the utm parameters to the site. But i do not want to pass it to a site within the WordPress website e.g App.
No i use the default WordPress Menu within the Avada template in Design -> Menu
I now use a javascript snipped where i defined a class name and each element with an outgoing link and this class, the utm parameters will be appended
I forgot to mention that the drawback of this solution is, that I loose the utm parameters if a visitor goes to another page within the website and then clicks the outgoing link. So in order to track it correctly, he has to use an outgoing link on the site he has been redirected during the ad or so
You seem to have some good questions, please consider joining our slack channel here https://www.haktansuren.com/slack-handlwp/ 🙂
Hello,
I’ve installed contact form 7 plugin along with Handl UTM grabber. However none of the UTMs are getting captured at the backend. What could be the issue here?
Hi,
I see you opened a support ticket on https://wordpress.org/support/topic/not-capturing-utms/. I have just replied to your latest comment. Thanks!
I will send it to you as soon as I implement the code into the plugin. It will be within a week or so. I will update you here as well.
Anyway you can send me just a link to it, I need to implement this asap, although I appreciate you putting it in this plugin as a feature, I just want to be able to test out certain options. Let me know if that is possible.
Is there a way to add new parameters to the plugin, example: utm_cb=[utm_cb]? Also any update on the automatic appendage of the UTM?
Actually I did figure out how to add my own parameters into the plugin! Great plugin!!
Thanks for letting us know here Aaron, we also appreciate sharing your workaround for other ppl having similar problem. Thanks!
Hi, I’m trying to use your plugin to capture the information that other plugin (webinarignition) capture in a form, but apparently is not interpreting properly the information, here is an example to try to show you the problem:
when I insert this:
instead of put the UTM info, send this “HandL UTM Grabber”
or with the shortcodes:
[utm_campaign_i][/utm_campaign_i]
this sends %s instead of the actual value of %s…
do you know how can I solve this?
the page hide the code of the first example, here is
….” “….
with spaces so this forum don’t delete it
input type=”hidden” name=”label:utmcantidadvisitas” id=”utm_campaign” value=”HandL UTM Grabber”
I also tried these options:
input type=”hidden” name=”label:utmcantidadvisitas” id=”utm_campaign” value=”[utm_campaign]”
[utm_campaign_i] input type=”hidden” name=”label:utmterm” value=”[utm_campaign]” / [/utm_campaign_i]
(with )
Can you send me the link where you are testing this?
Hello,
I’m trying with this page:
http://webinar.eduvolucion.com/finanzas-empresas-muy-pequenas/?artest=1?utm_source=pluginsupport&utm_medium=support&utm_campaign=supportplugin&utm_term=haktansuren&utm_content=testlink
This uses a plugin called webinar ignition.
thanks
Can you check if webinar ignition allows WP shortcode use?
apparently webinar ignition did not support shortcode 🙁
Sorry to hear :(. Thanks for letting us know.
Is the new “every URL” feature fully implemented? Is it working?
Yes, it is implemented fully. Please go to
http://yourdomain.com/wpplugins/wp-admin/options-general.php?page=handl-utm-grabber.php
and check “Append UTM” to activate the feature. Please note that, Append UTM feature is still on BETA, I appreciate any feedback.Hi, its only Working for me in the Article Text, not on Sidebar or Header and Footer.
Hi Erik,
Thanks for letting us know. What is the name of the theme you are using? I will do some more implementation for widgets, header and footer this week. So I can make sure it will work for your theme as well while testing it. Thanks!
hi, i am Using “Authority” from MyThemeShop
Hey Haktan, is this something likely to come out of beta? It doesn’t work on the sidebar as Erik says above.Our theme is AuthenticVersion: 1.0.8 by Code Supply Co.
I would like to buy you a beer for this plugin alone. it is amazing.
Hi Scacca,
Can you give me the URL so I can check what’s going on? S
Sure, feel free to donate to the plugin dev here https://wordpress.org/plugins/handl-utm-grabber/ 🙂
Hi, your new update V. 2.5.2 broke our custom parameters somehow. The parameter is cb=[cb].
On the old version (2.4), we get this http://behalftesting.wpengine.com/about/?utm_source=testsource&utm_medium=testmedium&utm_campaign=testcampaign&cb=true. cb=true is woking fine, this is a test site by the way.
New version (2.5.2), we get this https://www.behalf.com/about/?utm_source=testsource&utm_medium=testmedium&utm_campaign=testcampaign&cb=%5Bcb%5D. Now all links on the site have the query parameter cb’s value stay at cb=[cb], and it’s not working.
Could you please look into this? Thanks!
So let me understand this better. [cb] is the shortcode you append to your URL in your content. And somehow they are not recognized by WP (after the upgrade) as a shortcode so they are just printed as a shortcode (e.g. [cb])?
It appears to be that you are using “Append URL” feature. Can you just confirm? Thanks!
Hi, Haktan!
Is there Method to integrate your plugin into Woocommerce registration?
I need to analize orders by utm!
That’s actually a great idea. I have never thought of that. Let me try to find out a solution for this. I will update you regarding this by tonight (EST), stay tuned.
I stay tuned)
It seems to me, there is a moment when client has created order and came in checkout http://coaching-events.ru/checkout/, then he’s got to enter all the fields of the order. May be this is suitable moment to fulfil your plugin code after “Ssubmit” button …
This really great idea, the thing all e-commerce shops need use
Hi Alex,
Sorry for not returning you sooner. I have found a way to implement UTM and other variables into WooCommerce Order. This is just to let you know that I will make sure including this feature in upcoming version of HandL UTM Grabber.
Just wanted to check with you, Would you like to pass only UTM variables or other variables as well (such as, IP, landing page URL etc.)?
Hi, Haktan!
Glad to hear you found the way!
If it’s possible and not too hard – of course both UTM-variables and other variables as well (such as, IP, landing page URL etc.)
Could you say when upcoming version will be ready?
Hi Alex,
I am planning to new version including the WooCommerce support in Jan. I have just created a new Slack channel for the plugin, you are welcome to join to follow up with the updates (and support). Join via here https://handlwp.slack.com/shared_invite/MTMwODMwODAyODUzLTE0ODUwMzU3NDEtYjQwOTY3ZDQyMw
Hi, Haktan!
Thank you for inviting! I’ve joined to Slack
Sorry I do not know, would you say your first name – Haktan or Suren?
Thanks for joining. It’s Haktan 🙂
Hello Haktan! I can’t thank you enough for making this plugin.
I have a few questions about the plugin that I wanted to ask you. How can I join the slack channel
Hi Debarshi,
Check your email, I have just sent you an invite.
Great plugin, how do i add the shortcode to WooCommerce email order templates ?
Hi Simon, Not sure if WooCommerce allow shortcode on email order template, I will check it out and let you know soon…
Hi Simon,
Sorry about the delay… I figured that you can do this in two different ways.
Way #1
Dashboard > WooCommerce > Emails > New Order > Copy File To Theme
This will generate a PHP file under your theme folder. Edit the theme file your-theme/woocommerce/emails/admin-new-order.php
Find the line start with
and add those just under
Way #2
Create a plugin OR just add this into the function.php under your-theme/ folder
Hope it is helpful for you. If you have any further question regarding this, join our slack channel here
Thank you ill give this a go, post your PayPal email and ill send you over a beer.
Thanks Simon, you can donate to the plugin development here
Does this work in aweber? Been spending 5 hours trying. Happy to donate $20 if you can solve.
you can check code here:
http://jackcartertrading.com/list1/?utm_campaign=testcamp&utm_source=testsource&email=scott@scovert.com
when it was set for /$ or whatever, that was the literal value sent through – same with [utm_campaign]
I see that shortcode is spitted on the form. It may be because shortcode is not allowed in the plugin you are using.
Try using just the hidden input field as it is explained under “3. HASSLE FREE IMPLEMENTATION (NO SHORTCODE)”.
in aweber, when you make a new variable, you have to refer to it in forms as name=”custom variable”, instead of just “variable”
I think that presents a big problem?
It doesn’t have to be “name” parameter. Can you assign them a Class or ID? If you can, simply assign it like class=”utm_campaign”. If not, please provide me the plugin you are using for AWeber or how you implementing it. I will try my best to help you out. Also, consider joining our slack channel for better conversation https://www.haktansuren.com/slack-handlwp.
I am putting in aweber form as raw html text chunk in divi theme
would it help if I put it in a code element rather than text element?
not familiar enough with css or php to know how to implement class or ID, or how that would get the proper variable output into the aweber form
Can you join our slack channel here ?
Hey, I have just installed your plugin and this can really help me in tracking my campaigns well at the user level.
I want to append my UTM variables to all URLs (and not just the landing page) and I have checked in the option ‘Append UTM variables to all the links automatically (BETA)’.
But when I move from a landing page (homepage in this case) to another page on the website the UTM parameters are not being appended and they disappear.
Homepage (UTM Coded)
http://www.sitarambhartia.org/?utm_source=google&utm_medium=cpc&utm_campaign=brand-keywords
But when I navigate to another page, the UTM codes disappear example – http://www.sitarambhartia.org/maternity-program/
I need the UTM codes to be appended to all URLs from the initial landing page so can you please help me with the same.
I just replied to you via Slack @puneet.
Thank you for resolving the issue so quick – it works like a charm now!
Hi, I ran into the same problem as Puneet, please help)
Please DM me via Slack https://haktansuren.com/slack-handlwp/
Hi, I ran into the same problem as Puneet, please help)
Hi Haktan, I have (hopefully) a quick question. I added the plugin to my WordPress site to pass UTM user ID numbers that I receieve on my landing page on to another domain.
The idea would be have a URL like this:
https://businessadvising.org/get-started/lending-club/?utm_medium=12345
And when you’re on the page, from there, you would click on this link
https://businessadvising.geteverwise.com/roles/1/sign_up
and the “12345” example user ID would carry through.I set up that second link like this:
https://businessadvising.geteverwise.com/roles/1/sign_up?utm_campaign=[[utm_campaign]]&utm_source=[[utm_source]]&utm_medium=[[utm_medium]]&utm_term=[[utm_term]]&utm_content=[[utm_content]]&gclid=[[gclid]]
But, when testers click through, instead of
https://businessadvising.geteverwise.com/roles/1/sign_up?utm_medium=12345
we’re seeinghttps://businessadvising.geteverwise.com/roles/1/sign_up?utm_medium=utm_campaign
Any idea what I’m doing incorrectly?
Sorry, forgot to add the code classes. Here’s how the second link is set up:
https://businessadvising.geteverwise.com/roles/1/sign_up?utm_campaign=[utm_campaign]&utm_source=[utm_source]&utm_medium=[utm_medium]&utm_term=[utm_term]&utm_content=[utm_content]&gclid=[gclid]
Your implementation seems correct. I was wondering why you are not using the “Append UTM” (make sure you are on latest version) feature? It is under Settings > HandL UTM Grabber. It does this automatically without you having to do it manually. Let me know how it goes.
Hi Haktan — I see it now, and actived it. It doesn’t seem to be working/doing anything? If I go to the landing page using this appended url: https://businessadvising.org/get-started/lending-club/?utm_medium=12345
and click on the link, the utm doesn’t follow to any other links, either on the same domain or elsewhere.
Any ideas for troubleshooting?
Sorry! I’m trying this again, and it may have been a cache issue as to why I couldn’t see the utm trailing from page to page. It might be working now. Just so I know, have there been any conflicts with Internet Explorer/Edge, or Chrome?
Last update: the “Append UTM” setting works for URLs when users are logged into WordPress (like admins), but not for people who aren’t. So, it’s still not working correctly. I hope that last bit of info helps for troubleshooting.
sure? maybe another cache problem? I was not able to reproduce the issue? Possible for you to create a test page for me? And please consider joining our Slack channel for fast response https://www.haktansuren.com/slack-handlwp
Hey Haktan,
Love this plugin! If someone comes to my website with the UTM string attached (lets say via a text ad), then leaves, and comes back later via a link without the utm string (lets say organically or types in the url directly) will the plugin still recognize that the person came to the site originally with the UTM string and attach it? This is of course assuming this person doesn’t block cookies and didn’t clear their cache or anything.
Hi Lane,
Thanks for the feedback. I am glad you find it useful.
About your question, yes you are right. The user will be tagged with the same UTM after second visit (even though w/ no UTM) FYI, the cookies are set to expire after 30 days.
Let me know if you have any other question.
Cheers,
That is fantastic thank you!!
The Best Plugin! Thanks!
But 30 days are very much for my case. How can I set 15 minutes for cookies expire?
It is easy to change in the code. If you need help, please reach out https://www.haktansuren.com/slack-handlwp/
Hi!
I’m using the plugin “Retarget Engine” to load facebook pixel codes when I redirect the clients do the checkout page, because the checkout page is outside my domain. I tried do use [[utm_content]] in the destination URL on the Retarget Engine plugin, but does not working. How can I solve this?
Hi Eduardo,
Do you know if “Retarget Engine” supports shortcode?
I don’t know 🙁
OK allow me to investigate this, I will let you know if I have anything…
Thank you!!
Hey Eduardo, Can you join our slack channel and reach me out from there? https://www.haktansuren.com/slack-handlwp/ Thanks!
Hi,
Awesome plugin!
It passes the UTMs no problem and shows the previous page and the form origin page well. However, I get intermittent results with the referral and landing page – sometimes it works sometimes it doesnt. Usually if i land directly on the form page it works but if i browse it wont capture it. I get random page addresses that i didn’t even visit.
Here’s the link:
http://www.metrocompactor.com/commercial-marathon-equipment/self-contained-compactors/rj-100sc-series-compactors/ (form is at bottom)
Hi yivgeni,
I have not been able to reproduce the problem you have encountered. Any specific way to reproduce?
Thanks,
Haktan
Hi Haktan,
Let me give a specific example of what I mean:
I put handl_original_ref to see what the original site is from which the person came to my site and filled out the form. But i now clicked on the link i posted in the comment and came to my site from this site, and after 3-4 pages submitted the form. This is what I got:
Campaign Name:
Campaign Source:
Campaign Medium:
Campaign Term:
Campaign Content:
Gclid:
Referrer:
http://www.metrocompactor.com/commercial-marathon-equipment/vertical-balers/heavy-duty-vertical-baler/
Landing page:
http://www.metrocompactor.com/commercial-marathon-equipment/vertical-balers/heavy-duty-vertical-baler/
Previous page:
http://www.metrocompactor.com/commercial-marathon-equipment/stationary-compactors/
Form origin:
http://www.metrocompactor.com/commercial-marathon-equipment/stationary-compactors/rj-225-compactors-reduce-solid-waste/
Previous page and form origin are correct, as is the landing page. However, for some reason the referrer is always the first page on MY site and not the actual site I came from? Unless I fill out the form immediately without going to any other page first.
Thanks for detailed example. It helps!
First of all some websites suppress sending referrer using
rel="noreferrer"
or
<meta name='referrer' content='no-referrer'>
I am not sure why my site does not send referrer but I just confirmed it does not (I will look into this and fix it). But if you test this with Google, you will see the handl_original_ref will be populated correctly (it will capture the first referrer even though user visits multiple pages before they submit the lead form, as it is expected)
To reproduce, simply Google your site name click the result and you will get the following..
ah! That explains it! Thank you very much
This is such a great plugin 🙂
Great tool thank you.
Unfortunately I am working with a form tool that insists on rewriting form element names. In your example above class=”utm_campaign” can work. What if there are other styles in that element eg class=”mauticform-hidden utm_campaign” ?
Hi Alan,
Have you tried using the other methods (e.g. shortcode)? Can you let us know more about the way you are using the plugin? Thanks!
Hi Haktan, at the moment the forms are being added via a line of javascript which gives me limited control. I am trying my best not to have to replace ALL forms with their HTML version.
If multiple elements in a class does not work then i might not have a choice.
Thank you for the reply.
Yeah that’s the only thing i can think of right now. Sorry, I wish I could help more!
Btw, Would you be interested in a customized version of the plugin for your case? You can get in touch with me via https://www.haktansuren.com/slack-handlwp
Hi Haktan,
Seems like the parts after %20 is cut out of the utm values. %20 is automatically replaces space when you use google url builder to generate links with utm codes. Is there a solution for this, where the whole content for the utm tag is captured instead of the piece until the %20?
Hi Jay,
Can you give me a test URL so i can test it. I could not reproduce this on my local. Thank you!
Hi Haktan
This is working well elsewhere on our site but please could you help me work out why the UTM codes aren’t being passed through on our “Back to Summit” button on this page?
https://summits.brighttalk.com/summit/digital-banking-2/its-all-in-your-hands-mobile-banking-apps-and-personal-finance/?utm_source=TestTimes&utm_medium=NewspaperJuly&utm_campaign=TestMcTestfacePromo
Thanks!
Clare
Hi Clare,
Please note that auto append feature is still on beta. It is not guaranteed that it auto appends to every anchor link on the page.
In your case, it seems like “Back To Summit” link is one of the exceptions. Your theme seems like custom coded, so I am not fully sure what’s going on until i see how it is coded. My guess is that it is either rendering after page load or it is not using proper WP functions (e.g. nav_link etc.). May I ask why you want to append the UTMs on that button? UTM Grabber works COOKIE based, that means when user lands on your page, UTMs are recorded in client’s COOKIE and then pass to the forms. I would be happy to help if you have more questions. You can reach out easier via joining our Slack channel.
Hi,
How easy would it be to tweak the plugin so that and additional variable?
For example, http://www.mysite.com?salute=hello
Hi Lawrence,
Do you mean using auto append feature? If you do, it is pretty straight forward. I can help you setting it up if you can reach me via Slack.
I have the “Append UTM variables to all the links automatically (BETA)” unchecked, but it still appends the variables to each link. I could surely poke around and remove it, but don’t want to break anything. Can you tell me how to only use the variables on-demand (such as shortcode). I only need it to write to gravity forms inputs, and not carry the variables in the url.
Please and thank you.
Hi Mark, where do you test this?
In a fresh wp install on a staging server. It defaults to append the variables. Is there a particular portion I can comment out, or a past release, pre-append-all that I may be privileged to use?
The cookie piece is all I was really after. Just the cookie to grab the variables on the submit and add to our CRM to track from inception through a long sales cycle.
I am not sure why it is defaulted to active for you? Is it selected here http://www.yourdomain.com/wp-admin/options-general.php?page=handl-utm-grabber.php? If it is please unselect it. If this does not work, you can try editing the code handl-utm-grabber.php. Please comment out
, it is line 144 on latest version. Please let me know, Mark
I show Version: 2.5.9 and that line is not there at all. Is there a more recent version? I don’t show an update available.
Thank you, again.
HA! Well, still not fixed, but I double checked why I did not have that line. It is the one I removed (rather than commenting out), because it looked like the logical cure.
I’m still stuck. The UTM is still appended to links in my menus. Do you have any other suggestions to eliminate the UTM in URLs and just use it from cookies for my Gravity Forms?
Well, it is weird, that’s the function appends UTMs to URLs automatically. Can you join our slack channel here https://www.haktansuren.com/slack-handlwp/, I want to investigate this further. Thanks Mark.
Hi,
I am trying to do this also. I have commented out that line of code and the UTM’s are still being appended to all menu links.
I would like the UTM’s only to be caught in the cookies and tracked by gravity forms.
Or, if there is a way that the UTM’s clear per session? My website tracks the original UTM I landed on, however I have turned off my computer used a different landing URL.
thanks,
Samantha
Hi Samantha,
Do you mind joining our Slack channel and DM the URL you are having problem with?
Thanks,
Hi Mark,
Please update the plugin to the latest (2.5.10). It is a bug fix for auto append feature. Let me know if it fixes your issue as well. Thanks!
Hello,
Can I stop the saving of the utm var to the browser? I don’t want to send utm to my lead system when there is no utm in the address.
Thank you.
The plugin default is not to record anything in COOKIE if no utm provided in URL. So I am not sure what kind of problem you are having. Can you give me a URL to see the problem? Thanks!
I’m giving it a whirl. It looks like it is working the way I hoped. I’ll let you know if I run into anything.
Thank you for the great support, Haktan Suren.
Cheers!
Mark
Glad it worked Mark, Would you mind reviewing the plugin on WP https://wordpress.org/plugins/handl-utm-grabber/#reviews. It helps a lot. Thank you!
Is it possible to set a TTL for UTMs – so we can set how long the UTM is valid for – from it first being set.
Hi Dorian,
Unfortunately, there is no way to set a TTL for UTMs as of version 2.5.10. But this has been brought to me by couple more people. And I think it is a great idea. I will implement this in future releases and let you know. In the mean time, I can give you some more info about how to do it editing the version you have if you are interested in.
I am interested
Hi Haktan,
I have an issue where the UTM grabber is grabbing the “handl” variables but it doesn’t always grab the individual UTM variables.
So I see a url that has utm_source=”x”&utm_content=”y” (I know the parameters are there as they are in the handl original ref) but my wordpress webhook isn’t giving me {“utm_source”,”value”:”x”} and {“utm_content”,”value”:”y”}
Any help would be awesome. Sometimes I see this, sometimes I don’t and I can’t work out why.
Hi Kevin,
Are you using any caching plugin or using WP Engine?
Thanks,
Haktan
Hey Haktan Suren,
I am using ur handl utm grabber Plugin. its work awesome but at time it won’t store UTM Values. Example: utm stored for all main menu links like about, contact, blog and home link. when I click on Logo image it doesn’t store UTM and also for blog post i am not able to store UTM.
I think you are referring to “Append UTM to all URLs” function? Do you mind sharing me the URL you are testing this? Thanks!
Haktan Suren, pls find the link.
https://digitaltechiehub.com
Yes, I think i see the problem. Let me see if I can do something generic with the logo. But I think i can figure our the blog post title. Just to verify, you mean this title right https://i.imgur.com/4UUaApw.png? In the mean time, would you mind joining our slack channel so i can communicate you better https://www.haktansuren.com/slack-handlwp. Thanks!
That’s great. I gave joining request. Pls accept it.
Yes, this is the blog title. “https://i.imgur.com/4UUaApw.png?
Hi Haktan,
I am using your plugin Handle UTM Grabber and it works great but I have small problem.
You can see here:
http://www.nejlevnejsipovinneruceni.cz/pokus-url/?utm_source=testsource&utm_medium=testmedium&utm_campaign=testcampaign
1) As text the UTM are displayed correctly
2) As part of link it is added correctly (href=”http://www.salvepojisteni.cz/frames/povinne-ruceni/krok-1.aspx?affiliatePartnerId=1&utm_source=testsource&utm_medium=testmedium&utm_campaign=testcampaign”)
3) But in iframe as link in source attribute it stays as shortcode instead of values:
src=”http://www.salvepojisteni.cz/frames/povinne-ruceni/krok-1.aspx?utm_source=[utm_source]&utm_medium=[utm_medium]&utm_campaign=[utm_campaign]”
Am I doing something wrong with iframe or can I use some PHP code instead of shortcode? What is the PHP code?
Thanks in advance
Tomas
Hi Tomas,
Can you join our Slack channel here https://www.haktansuren.com/slack-handlwp, I will share a custom version of the plugin with you.
Thanks,
Haktan
Joined, thanks in advance
How do I change the add another variable for the plugin to recognise and grab? For examplesomeone comes to the site with mydomainlink/?userid=xyz123. I need ?userid=xyz123 appended to outgoing links.
You can only add extra params editing the source code. Please join our slack channel if you want to know how to do it.
im trying to capture the gclid in gravity forms but not succes, any tutorial?
what is the version of gravity form plugin you are using?
Hi!
I am Sam Kim from KPI Healthcare Inc. I think it is a very useful plugin. But, I found a small bug.
source : handl-utm-grabber.php
line : 28
$_COOKIE['handl_url'] = isset($_SERVER["HTTPS"]) ? 'https://' : 'http://' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];;
----------------------------------
$_COOKIE['handl_url'] = isset($_SERVER["HTTPS"]) ? 'https://' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"] : 'http://' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
Thank you Sam, I fixed it and will push it into the new release this week.
Hi Sam, Just wanted to let you know that, this bug has been fixed as of 2.5.12. Please let me know.
I have confirmed that all issues are well resolved.
Thank you for your support.
hi!
So, it might be a WP shortcode thing, but the codes aren’t going through..
“&utm_source=%5Butm_source%5D&utm_medium=%5Butm_medium%5D&umt_campaign=%5Butm_campaign%5D&utm_content=%5Butm_content%5D&utm_term=%5Butm_term%5D”
How can I fix this?
Hi Alicia,
Can you give little bit more context about how you are implementing this? So, I can help better.
So, when it’s in HTML form it works, but when putting it in the header, footer or any “button” if just doesn’t work and gives me this instead: utm_source=%5Butm_source%5D&utm_medium=%5Butm_medium%5D&umt_campaign=%5Butm_campaign%5D&utm_content=%5Butm_content%5D&utm_term=%5Butm_term%5D”
– does this make sense?
our theme is AC Theme.
Hi Alicia,
Did you try “Append UTM” feature in the plugin? Please see here: https://i.imgur.com/VfJmihe.png
Hi,
I am trying to place a capture the utm_source & utm_campaign, and output them into a dynamic php output for the last page in pagination. I have tried http://reactshare.com/exit?utm_campaign=”, but this does not work. Everything I try breaks the website.
Basically I just need to append the campaign/source to the end of the link http://website.com/exit that you see in the code below. Thanks for any help!
protected function callback_render_pagination() {
$buffy = '';
$current_page = $this->get_current_page($this->list_items);
$total_pages = count($this->list_items['list_items']);
// no pagination if we have one page!
if ($total_pages == 1) {
return '';
}
// echo $paged;
// echo $total_pages;
if ($current_page == 1) {
// first page
$buffy .= '';
$buffy .= '' .__td('Back', TD_THEME_NAME). '';
$buffy .= '_wp_link_page($current_page + 1) . '">' .__td('Next Page >', TD_THEME_NAME). '';
$buffy .= '';
}
elseif ($current_page == $total_pages) {
// last page
$buffy .= '';
$buffy .= '_wp_link_page($current_page - 1) . '">' .__td('Back', TD_THEME_NAME). '';
$buffy .= '<a class="td-smart-list-button td-smart-next" rel="next" href="http://website.com/exit?utm_campaign=''">' .__td('Next Page >', TD_THEME_NAME). '';
$buffy .= '';
}
else {
// middle page
$buffy .= '';
$buffy .= '_wp_link_page($current_page - 1) . '">' .__td('Back', TD_THEME_NAME). '';
$buffy .= '_wp_link_page($current_page + 1) . '">' .__td('Next Page >', TD_THEME_NAME). '';
$buffy .= '';
}
return $buffy;
}
Can you join our slack channel here and send me the code there? Thanks!
Trying to switch phone numbers on site based on UTM Campaign
Hi Mark,
Currently, there is no such option but I can help you implemented if you are interested in. Please find me at Slack
What would you charge to help?
We basically have a list of UTM that have associated phone numbers and need the hyperlinks (click to call based on the utm) wherever it is displayed.
We have using your plugin in 2 website with Append UTM, But only one website is showing UTM code on all webpage urls and one is showing nothing. Can you help me on this.
Do you use any caching system like WP Engine? are they hosted on same server?
https://www.etwomensforum.com/?utm_source=facebook&utm_medium=promoted&utm_campaign=welcome
i checked on Append UTM variables to all the links automatically (BETA)
and saved
button only header menu is taking UTM
rest of all href links like images and buttons are not working in UTM url
Yes, as it is indicated in the plugin, Append UTM is still on beta. It is really hard to make it compatible for all the plugins and themes. But we are working hard.
Is it work for my theme or not..?
hard to tell without testing it…
Hi Haktan, first of all, great plugin you have.
There’s only one issue I can’t resolve.
Whenever there’s no UTM parameter in the URL, the plugin will still forward the LAST UTM used, by another user.
That means if a user signups up with utm_source=”fbad01″, and another user later, that came straight from a Google search (no UTM), signs up too, he’ll keep the “fbad01” UTM as well, when it should be blank.
Is there a workaround?
Thanks!
Hi Eduardo,
Thanks for the kind words.
To answer your question, cookies are not saved across users. That means, one user’s cookies can’t be accessed by other user (this is a basic security future of the browsers) unless both users share same computer and browsers. If they are not sharing computer/browsers, and if you think cookies are transferred to another user, i would say it might be due to the caching problem… That means the first UTM is cached in the HTML and the same cache version of the page is served to other user. Are you using WP Engine?
That makes sense… I’m using Thrive Leads, this is the squeeze page: seocomprovado.com/fb/
If I edit the lead form code, the “ value= “ will be filled by the last user data… any suggestion how to fix that?
Are you using any caching plugins? Try excluding that page from cache and see if it helps.
Hi Haktan,
Your plugin work well 🙂
I have a little question, if a visitor come on my website with UTM link and is close the window & reopen my website without utm for make a registration, your plugin can get the initial UTM or not ?
Many thanks
Yes exactly. This is exactly the meat of the plugin. UTM is recorded in the COOKIE and passed to the leads later on. So technically, user first lands on the page, plugin records the COOKIES in client’s browser. A few weeks later, user visits the website again (w/o UTMs in the URL) and opt-in. UTMs are still passed to the opt-in and eventually to the CRM. Hope this clears out.
Hi,
Ok but on my side, it’s doesn’t work, if the user register on page with utm the plugin take the utm info, but if change page for register without utm, the plugin doesn’t catch the UTM infos.
can you help me?
the problem seems to be recording in client’s cookie then. Would you mind joining our Slack channel https://www.haktansuren.com/slack-handlwp and send me the link that you are testing.
Could you look into my issue on WordPress support page?
https://wordpress.org/support/topic/url-fields-not-pulling-into-cf7/
Also, I do not see option to append UTM to all links. Where is this setting?
I’ll reply the ticket as soon as i get the chance. Please check “HandL UTM Grabber” under Settings for “Append All” feature.
Found the settings, thank you. I was looking for settings under the plugin itself. Working on your response on the wordpress plugin page now. Will update there if resolved.
Is it possible for the plugin to store info about the referring source? More specifically if the visitor came from Organic Search or Direct?
yes, use handl_original_ref shortcode
Are you available for customization? I want to be able to set a cookie to say “Organic” IF handl_original_ref contains GOOGLE or BING.
Let me know if you think that is possible.
Right now, in our CRM it looks like this:
https://www.google.com.gh
https://www.google.com
https://www.google.ca
https://www.google.co.uk
https://www.bing.com
And they just want the field to say:
Organic
Please join our slack channel and DM me.
Have you experience this not grabbing autotagged Adwords UTMs? I tested using the UTM appending tool found here (https://ga-dev-tools.appspot.com/campaign-url-builder/), but I am not seeing UTMs pull over from paid media, even though I do see the Google Click ID. Does my SEM team need to manually append UTMs rather than use autotagging?
Hi Mike, Can you give us more detail how you are capturing the UTM values now? Are you using the shortcode? Where do you pass the data etc… Thanks!
Yes, I am using the short code wrappers to create the hidden fields. Then I use the shortcodes in a plugin to pass ContactForm7 data into Bitrix24. It seems to only be the UTM fields that are not being passed through though
Can you send us the URL where you are testing plugin?
Yes, it is installed on this site, https://haletrailer.com. There is a contact form at https://haletrailer.com/locations/
just confirmed that the cookies are populating. Can you manually append UTM to your URL and test if it is captured. As far as I know Adwords automatically appends UTMs to the URL, you do not have to manually include them
Yes, they were working when I was manually appending. it just seems Adwords auto-tagged ones are not being captured, though we double checked the setting. I believe my SEM company is working on manually setting up the UTMs now to see if it helps.
[…] If you are not familiar with HandL UTM Grabber, or want to learn more about what you can capture, please visit this page. […]
Hello!
I had an AWOL web developer create cookie which did what I think your plugin does, however after I migrated the site to a new hosting provider it stopped working, so I downloaded your plugin hoping it might be a solution. I have gravity forms and have the utm fields in my form setup the way you suggest. Most of my traffic comes from adwords and bing ads, which has the utm info appended to the URL, however the utm parameters are still not populating in the form fields. The form can be found at the website link below. Would mind checking it to see if I did something wrong? It would be much appreciated. Thank you so much!
What is your new host? WP Engine maybe?
It is WP Engine.
Please join our slack channel and DM me https://www.haktansuren.com/slack-handlwp/
Okay.
with the option “Append UTM variables to all the links automatically” the URL like:
https://www.vivoidiomas.es/wp-content/uploads/2018/07/Seguro-Cancelación-VivoIdiomas.pdf
with options:
* _blank
* Title
construct a URL like:
https://www.vivoidiomas.es/wp-content/uploads/2018/07/Seguro-Cancelación-VivoIdiomas.pdftitle=“Seguro
or
https://www.vivoidiomas.es/wp-content/uploads/2018/07/Seguro-Cancelación-VivoIdiomas.pdftarget=“_blank”rel=”noopener
and product error 404 in this URLs
Thanks
Thanks for reporting this, Jose. I’ll fix it and let you know.
How can I get this to work with latest NinjaForms and pull data from my own custom utm “utm_adcode”? I know NinjaForms 3 now allows for pulling a UTM via {querystring:utm_adcode} in the default value if that helps.
HandL UTM Grabber is fully compatible with Ninja Forms. You can use the merge tags (https://twitter.com/HaktanSuren/status/1004217579324526592). Unfortunately, I did not have time to write tutorial but it is in the road map.
Is it possible to use my own utm tag though? I need “utm_adcode”, but have been unable to achieve this. Also, need it to pull from a cookie in case users navigate around site before submitting web form. Really hoping you have a solution for this custom UTM!
Yes, I can give you the custom version of the plugin. Please DM me via Slack
Based on 3. Hassle Free Implementation (No Shortcode) , do the input class need to only contain that particular class in order for it to work and also does the input type need to be set to hidden?
Because I’m using wpforms, and I used jquery to target the specific input id that currently contain a class called “wpforms-field-large”, and add a new class called “utm_source”. And the input type is equal to “text” since there is no option to make it “hidden”.
Then I tried to fill the form without filling in the “utm_source” field, but when I received the e-mail, it’s just showing blank.
1. As long as one of the class for the element is utm_source, it will work.
2. No, the type can be both text or hidden.
Where did you implement this? Would you mind sharing a link so I can check?
[…] of the most repeated questions I get from HandL UTM Grabber community is how to pass UTM parameters to ActiveCampaign. Although there is no straightforward […]
Just wanted to say thanks for the plugin and all the support to others which in turn helped me…. after a long day tinkering and trying complimentary WP plugins I finally have a working setup..
My Contact Form 7 Form can now pass the UTM data (from bing ads) to Zoho CRM to do tracking with…
A mixture of your plugin..
Plus two other free plugins:
‘Contact From 7 Dynamic Text Extension
To create the hidden fields for the various line items (campaign, keyword etc).
i.e.
[dynamichidden utm_campaign “utm_campaign”]
Plus WP Plugin: Zoho CRM Lead Magnet’ which Allows you to use Contact Form 7 forms instead of their own uglier ones, and assign fields so it aligns with those setup on the CRM.
I’m still struggling to get the Gclid setup working, as Zoho’s guide for this is a little vague when it comes to 3rd party forms.
Again many thanks.
Hi Jon, Thanks for the feedback! Very well appreciated.
As for gclid, it should work the same as other UTM params. What is the problem you are having exactly?
Hi Haktan, thanks for asking, I’m still struggling with sending Gclid to Zoho.
Though this probably falls outside the scope of your plugin. Though if you have any insight that would be amazing.
Instead of using ‘WP Plugin: Zoho CRM Lead Magnet’, to send on the fields to Zoho CRM. I’m now a very similar but paid option ‘WP Plugin: Contact Form 7 – ZOHO CRM Integration’. This at least shows the field for GCLID (that Zoho automatically creates along with other google adword fields, when you link Zoho CRM to your Adwords account).
I can successfully grab Gclid information that your plugin obtains, and pass to a hidden dynamic field using the code:
[dynamichidden GCLID “gclid”]
*I’m using the test url : www. mydomain .com /?gclid=test
When I assign this data to a different text field at Zoho CRM via the plugin mentioned above it appears fine. i.e. if I assign it to a Twitter field I can see the data in my lead file.
However if I assign it the Gclid field Zoho CRM, no data comes through.
Zoho’s support on this is pretty lacking, as they don’t seem to help with API issues or understandably 3rd party plugins.
I’m trying to use your plugin to send the Google Adwords info ‘Gclid’ to Zoho CRM.
I’ve got the hidden field ‘gclid’ working with the correct data being collected in the form.
I’m using a test URL rather than clicking a Google Ads.
domain.com/?gclid=test
I need to send this to the GCLID field on Zoho CRM
If I assign it to a different text field (using your plugin) in a lead at Zoho CRM ie. to ‘Twitter’ the info arrives successfully and is visible in the Zoho lead file. Along with other fields like name, email etc.
However, if I assign it to the correct ‘field ‘GCLID’, it does not appear.
The Gclid field (and other google adword fields) in Zoho CRM are locked.
The only Zoho support forum post I can see that may be slightly helpful is this:
https://help.zoho.com/portal/community/topic/crm-api-v2-adwords-gclid-parameter
Though the coding is way over my head.
Thanks for any help on this… though I appreciate your plugin is doing what it is supposed to.
Sorry for the repeated text above… hopefully it still makes sense…
Hi Haktan,
Great plugin! I’m trying the new “Append UTM variables” and the URL parameters get appended everywhere except the top menu. LOL.. Any thoughts?
Thanks
Nik
Hi Nik, Can you give me the URL? It might be because, the theme you are using is not using standard wp_nav_menu.
Hi Haktan,
Thanks for the reply. The site is: http://www.anthonymeindl.com
Thanks again!
N
How did you create the menu bar? used any plugin?
Hi, I am using Elementor and am having the same issue as above – the UTM are passed to all links except the top menu. Here’s the site – fantasticstay.com
Any idea how can I solve this. I tried just manually adding them (append to the url ?utm_source=[utm_source] but it does not capture them, just get the same at the end. Any ideas?
Can you add a custom class to the each menu items? If yes, try adding .utm-out, if not DM me via our Slack channel
Muchas gracias! Works perfect now 🙂
Hi, do you do this grabber for drupal as well?
Hi, unfortunately this plugin is only for WordPress.
Hi guy
I need grab this url parameters:
aff_id
aff_subid1
aff_subid2
how Can I set this with URL Grabber plugin?
(ActiveCampaign form code)
Hi Andrea, you need custom version of the plugin to capture those variables. Please get in touch if you would be interested in having the custom build version of the plugin https://haktansuren.com/slack-handlwp.
I have just writed in #slack
Thanks, just DMed you in slack
Hello, I enjoy reading through your article post.
I like to write a little comment to support you.
Hi Haktan,
Great job with the plugin!
I have some troubles with caching though.
Is there a way to pass the parameters to url using some javascript snippet and not by shortcodes?
Thanks
Hi Tom,
Thanks! Yes, you can use utm-out class for the anchor and it will append the UTM values via JS
Yes! That would be great, because I have menu items etc that I don’t want to go through and add that link to. Thank you very much! bro keep it up nd also share your knowlge
Hey Haktan,
Thanks for building a plugin that answers my needs for passing UTM parameters through our site.
I’ve noticed the function to Append UTM variables to all the links automatically isn’t working though.
If it’s just an issue with that BETA function, can you advise how I’d add the utm parameters to a CTA button on site?
I’ve tried manually adding the parameters to my URLs (I’m using DIVI builder theme), but the utm values don’t appear to pull through.
Appreciate your help.
Mark
Hi Mark,
You can use utm-out class for the anchor and it will append the UTM values via JS
First let me express for thankful for a great plugin, it’s provide good idea, but i have some one issue, first i need to clear UTM parameter if the users close window. now it’s displayed even close all browser, I think this issue get from cache setting.
MUST BE the session of UTM parameter terminated if the window is closed.
Thanks again!
Hi Raad,
Trying to understand your question. Do you want the COOKIES lasts as long as the user session? That means, when user close the browser, you want all the COOKIES deleted?
Hi,
I have followed all above process, but i am unable to get UTM source, UTM medium and UTM campaign.
Did i have to setup UTM urls for the site
I am trying this process for the site:
https://theshores.umcommunities.org/
Please help.
Thanks!
Hi,
I do not see any hidden fields for UTMs on your form… Can you give more information how you implement this?
Hi ,
https://theshores.umcommunities.org/utm-testing-form/
This is the form , where we are trying UTM variables. I have addedd hidden fields over here. Please check and let me know…
Thanks!
Regards
Divya
Hi there,
Could you add the new fbclid that Facebook launched last days?
Best Regards
Please join our Slack channel so we can discuss https://haktansuren.com/slack-handlwp
Is it possible to pass the gclid to a subid in an outgoing link?
I am running an Adwords campaign to a page with affiliate links, and would like to append the gclid to the outgoing affiliate links as a subid.
Adding &subid=[gclid] does not seem to work.
Thanks!
Yes you can use the shortcodes for that. [gclid] should work, where do you test this?
For example, I tried it here: https://twosmartsavers.com/store/perfect-keto-coupon-code-deals
The URL after clicking through the affiliate link just says “&subid=[gclid]” even when I start the process by clicking through one of my Adwords ads.
what do you use for short link redirection? Seems like you are not using the shorcode in the content…
Hi Haktan, thanks for making this great plugin available! I am using it on this site: https://www.digitalfrontiersinstitute.org/the-institute/
The cookie is set successfully on the first page, but it is removed when I click through to more pages. It seems the cookie is still there on the second page, but it is removed on the third page I click to on the site.
I think it has to do with .htaccess settings, but I’m not sure how to resolve this. Would be great if you can offer some suggestions.
All the best
Hi Haktan, I am trying to use your plugin to save utm parameters from an ad campaign, but I am not getting any cookies saved.
The link of the ad campaign points to:
https://2000ocean.com/?lmcclass=lmc_track&lmc_track=7864755107&utm_source=TRDSF&utm_medium=ROSDisplay&utm_campaign=2000Ocean&utm_content=Ad
What am I doing wrong? Can you please offer any suggestions?
Are you on WP Engine? or using any caching software?
Yes the server is using varnish and I think that is the issue
Hi
HandL UTM worked just fine on our trial signup, but now it does not work. HandL UTM does not track [utm_campaign] any longer. The plugin solved exactly what we needed, so we hope that you can check what might be the problem.
Anders
Hi,
Can you provide me the URL? Thanks!
rayvn.global
I confirmed that utms are not recorded in the cookie. This might be a server or cookie problem. Are you on WP Engine? or using any caching plugin? Can you try disabling and testing it? Thanks!
Hi,
trying to use the plugin to save parameters on ukimmigrationsolclitors.co.uk to track where our leads come from. Things work ok if I put the utm tag directly in the URL but the traffic coming in from our Facebook ad (or any facebook link) doesn’t add a cookie.
I’ve read around the support forums and seen about caching plugins sometimes causing problems. We use WP Rocket and I’ve tested things with that turned off and the cache cleared, still no joy. Help!
Thanks
Neil
Can you share one FB link that does not work? It’s easier for me to troubleshoot if i can reproduce the problem.
Hello Haktan, thank you for your awesome Plugin! I have installed the plugin. I am using Elementor Pro Form, where I added the html text like it was told on this page (its in spanish but i think you will understand through the images: https://www.alimentoweb.com/blog/como-capturar-variables-utm-en-el-formulario-de-contacto-de-elementor/#Instalacion_del_plugin_HandL_UTM_Grabber
When I fill out the form, i get the utm values send to my email adress, but I also need it to send it to our CRM (Airtable). I installed a second Plugin where I have a database for the elementor from submissions, and there I cant see any of the utm values filled out. Do you know what the problem is?
What second plugin do you use to send it to CRM?
I dont have a second plugin which sends it to the CRM, i use a Web Hook with Zapier to connect the Elementor form with Airtable. The second Plugin is just a database plugin which shows me the filled out data from the elementor form, its called Elementor Contact Form DB.
Hello there. When I use wp fastest cache, utm values does not write cookies. I canceled the javascript minimization settings.but the same error. what should I do?
Can you disable the plugin and test again? It might be server rather than the caching.
Haktan, this is a great plugin!!
The only issue that I am having is that for some reason [utm_campaign], [utm_source] and [utm_medium] are not printing any variables on my site https://libertacaodigital.com.
Is that normal?
The other shortcodes work correctly. Any idea on how to solve this issue?
Also, I think this plugin does not store the variables if passed with ‘#’ instead of ‘?’, right?
When redirects occur, as mentioned on this article – https://www.en.advertisercommunity.com/t5/Google-Analytics-Code/Redirecting-url-with-utm-parameters/m-p/1160663#M8858 – sometimes variables after ‘?’ are erased for some reason, but we can pass them using ‘#’ so that Google Analytics can track them.
Well, let me know.
Again, thanks for the amazing plugin!!
Do you mean utm_term works but [utm_campaign], [utm_source] and [utm_medium] don’t? I think this depends on your implementation. The logic for capturing them is same, there should not be any inconsistencies.
Yes correct, it has to be passed as a URL parameter. You will not be able to capture them with #. But do let me know if you need the custom version of the plugin. I can implement it as you need. Feel free to DM me via https://www.haktansuren.com/slack-handlwp/
If my visitor access a page today from a UTM-tagged link and come back tomorrow, when he/she fills a form out during the second visit, will I get the UTMs from the first visit?
Yes correct, UTMs are saved in client-side (cookies) 30 days after user makes his/her first visit.
Hello Haktan, thanks again for your work you saved us many hours!
We have the plugin activated but no campaigns running currently. We have noticed that when a customer fills out the form we still get the utm from the previous facebook campaign although the customer wasnt targeted in this campaign. We have the Swift Performance Lite Plugin activated to clear the cache maybe both plugins are interfering with each other.
Is this a known problem? And if yes, how can it be solved?
Can you stop it running on a page?
I seem to have a compatibility problem with a special page that fails to load when the plugin is enabled.
It works as expected on all other pages, which is all I need.
Yes it is possible with the custom version of the plugin. But I highly recommend fixing the problem. What is the compatibility problems? Can you send send me the URL you are having the problem with?
Just this page.
https://www.supawood.com.au/tech-info/finishes/
It seems to be the plugins the developers used to create the choices of the finishes.
Already we have had issues with updating the used plugins, not got development practise was used.
is HandL UTM Grabber activated on https://www.supawood.com.au/tech-info/finishes/? I do not see it in the source code, but it is heavily cached and minimized maybe that’s related to the problem you are having?
Its not active … pages goes blank …
I can ask if they will allow it to be activated for a short period?
We can activate again in 3 hours time. Will that suit?
Hey Adam, sorry about my delayed response. Feel free to join our Slack channel so we can try to fix the problem you are having there. https://www.haktansuren.com/slack-handlwp/
Haktan,
I’ve been using your plugin for a while for UTM tracking. I was just tasked with tracking landing pages which I see that your plugin also does, but handl_original_ref and handl_landing_page don’t seem to be working correctly. I’m using them in a Gravity Form.
I start from innervoicegroup.com/utm-test/ and click on a link to medicarecrmgroup.com/tyler/, I navigate to the home page, and then to medicarecrmgroup.com/services/property-casualty/ where I fill out a form.
For original_ref I get medicarecrmgroup.com
For landing_page I get medicaregroup.com/services/property-casualty/
Hi! Fantastic plugin, thank you for creating this!
Question, if the lead comes from an seo search, would the hidden fields (in Gravity form) populate?
Thanks!
How would I go about setting up a custom UTM value? Do you plan on adding the ability to add custom UTM’s in the future (other than just the default values)?
You need custom version of the plugin for that. Please DM me via Slack and I can get you the custom version https://www.haktansuren.com/slack-handlwp/.
Hello, Haktan! I’m from Brazil and I would like to thank you for this awesome plugin!
I’m having an issue:
My facebook / instagram campaigns are working perfectly. The UTM appears on Calendly (calendly.com) conversions to schedule a meeting but the problem is:
I wanna know which terms of my adwords campaign are converting more and the plugin does not capture the utm to a second interacion. The conversions in calendly comes blank to the users which came thru a Google Ads campaing.
website: planofp.com.br
the user first goes to home (planofp.com.br) and then: “agendamento online” – “schedule a meeting”.
We are using WP fastest cache and auto optimize plugin, is there a problem with it?
I’ll talk to the owners of PlanoFP to donate ASAP!
A big thank you,
Andre.
Hi @Andre, can you confirm if the plugin is active rn?
Haktan,
Do you know how to implement this in Caldera Forms?
Thanks
Hi there!
I’m trying to use this on a standard web-to-lead form, but the value is not populating.
here is my code:
Why isn’t the value populating when I look at the lead in Salesforce. I’d rather not use the web-to-lead plugin, as it hasn’t been updated for the latest version of wp.
Am I doing something wrong here? thanks
hi, I’m getting %s as the value, how can I populate the value with the UTMs?
Hi,
I hope that you’re doing well. I am having a very hard time with the plugin. I am using contact form 7. I copied/pasted the stuff into the forms per your instruction, but the utm codes are not being captured.
The email we’re receiving have nothing in those fields, nor are they being captured by Flamingo, which we use to organize inquiries.
Please advise. Thank you very much for your help.
How can I disable this on a per-page basis? I’m trying to open a YouTube video in a popup, but it will not work when the UTM is added to the link. As soon as I disable this plugin, it works.
i replied you on WP.
Hi,
I’m using a button url link like this:
https://domain.com/?utm_source=Facebook&utm_medium=cpc&utm_campaign=test&utm_content=YTA1&gclid=%5Bgclid%5D
but when I click the button it takes me to the following url:
https://domain.com/gl-1/?utm_source=Facebook&utm_medium=cpc&utm_campaign=YOUTUBE&utm_content=YTA1&gclid=%91gclid%93
so the [] are messed up, how can I get this to work please?
It is called URL encoding (https://www.permadi.com/tutorial/urlEncoding/), you should still be able to read them fine depending on your implementation.
Thanks Haktan!
Could I get you to edit my post above to remove the links as I shouldn’t have posted them live and I can’t edit the post myself please? 🙂
great extension. it works perfectly on a dev site I’m working on.
It’s not working on the live site, which is hosted on WP Engine. I noticed a few old comments asking if people with issues were using WPEngine. Could you let me know if it’s possible to make it work?
Yes you can ask them to whitelist UTM params to be cached in Varnish. If you need a sample email from previous WP Engine customers, reach me at Slack via https://www.haktansuren.com/slack-handlwp/
Thanks, I’ll get in touch with WPEngine support. Are you aware of any conflicts with Cloudflare?
there is no conflict with CF as far as I know.
Hi – Having same issue (I think). Site is on wpengine. Would it be possible to get this sample email verbiage as well?
Site is https://customdoorshop.com. Trying to get these parameters into salesforce, but first we need to actually get them into the Gravity Form 🙂
thx
This is the sample ticket you can refer them to Matthew https://help.wpengine.com/hc/requests/990054
Thank you! Got it working. Love this!
Hey Haktan,
I’m using WPForms on a website and I am having trouble getting it to call your shortcodes. It seems I can create an invisible html field, but when I submit the form it doesn’t collect the info. Any advice? Thanks!
You need a custom version of the plugin, please DM me on the Slack channel so I can help you better https://www.haktansuren.com/slack-handlwp/
[…] HandL UTM Grabber plugin allows to capture UTM parameters, track them throughout the pages with ease and pass the data to 3rd party CRMs. I launched this plugin in 2016. And since then, the plugin has been downloaded more than 15k, documentation blog post viewed ~400k times having more than 250 comments and several people reached me out through social media and our official Slack page. […]
Hi I am using this plugin with Contact Form 7 to capture the lead source, I am getting sources from fb, twitter, youtube but not from linkedin and gmail. Can you please help with this
code i am using is this :
[handl_ref_i][/handl_ref_i]
[handl_url_i][/handl_url_i]
page url is hosted on website
Some websites may block the referral being captured by other sites. Maybe, linkedin and gmail are doing that.
than how to do that for these two ? do i need a different plugin
if it is blocked, i am afraid you can’t capture it… It is not technically possible to do it.
Can you suggest a way out of this ?
Are you a coder? if yes, you can check the SERVER variables to find out how they do the redirect…
Hi there –
This plugin is great! We have been using it to pass UTM parameters from our event site (https://figurativeartconvention.com) to our shopping cart (https://streamlinepublishing.com/s/).
That said, I’m noticing that the UTM is only being appended to the buttons and menu links when I am logged in.
When I am using the site as a regular user, the UTM does not carry forward to the next site.
Is this a setting or perhaps an error in my implementation?
See an example here: https://figurativeartconvention.com/?utm_source=haktan_suren and then click one of the REGISTER buttons to go to the second site.
Thank you for your help!
Cross websites can’t share cookies due to security. You need to append the UTMs to target URL… Tried using Append URL feature? if that does not work, you should append UTMs manually using the shorcode (see WHEN TO USE? section #1 here https://www.haktansuren.com/handl-utm-grabber/)
Thanks Haktan. How do I use the APPEND URL feature? I swear this worked on this site until the latest update (though I could be waaaaay out to lunch on this!)
Simply go to Settings > HandL UTM Grabber and Enable “Append URL”
Gotcha. Yes, I’ve got that turned on but it’s not appending on the live site: https://figurativeartconvention.com/
Oddly enough, when I’m logged in as admin – it does append (!?)
I’m using v2.7.1 and have tried turning Append off, saving, and then turning it back on… no luck.
I can send a screen recording if you’d like?
recording sounds good. Btw, you can join our Slack channel https://haktansuren.com/slack-handlwp/ might be easier to troubleshoot there.
I am using Worpress with your app and ninja forms and cannot get it to collect/pass any utm parameters. I also have the ninja form analytics add-on.
your first instructions: Add your hidden field into your form. And expand “Advanced Settings” and put “utm_campaign” or other shortcodes (without wrapping it in bracket) in Custom CSS Classes and hit “Save”.
BUT: in my ninja forms hidden field there is no “custom css classes” box
Your second instructions; 3. HASSLE FREE IMPLEMENTATION (NO SHORTCODE)
Upon ativation of this plugin, it will fill the elements named “utm_source, utm_medium, utm_term, utm_content, utm_campaign, gclid” AUTOMAGICALLY! (by element name, id and class)
did not work either.
Please help. this sounds like a great app but I cannot get it to work.
Hi Brad,
Please join or Slack channel (https://www.haktansuren.com/slack-handlwp/) you can find how to use merge_tags feature in Ninja Form (https://handlwp.slack.com/archives/C3VCRHU2K/p1528086008000138) for easier implementation.
Sounds good! Submitted a screen recording on the Slack group.
Thanks Haktan!
Hello Hakan, what is the best way to get in touch with you regarding an issue we are having on our website with UTM grabber? In random instances, the parameters are not being tracked and/or pushed over to our database. The grabber seems to work when we are logged into WP but when we log out we are seeing instances of it not working within the same session/browser/device. We have HandL UTM Grabber version 2.7.1 installed, on WordPress version 5.2.3
Hi Byron, DM me via Slack https://www.haktansuren.com/slack-handlwp/
Dear Haktan,
I was using youre plugin for a year or so. Month ago it started crushing my website.
“An error with type E_ERROR occurred on line 177 of the file …/wp-content/plugins/handl-utm-grabber/handl-utm-grabber.php.
Error message: Uncaught Error: Call to a member function find() on boolean in …/wp-content/plugins/handl-utm-grabber/handl-utm-grabber.php:177
Stack trace:
#0 …/wp-includes/class-wp-hook.php(286): HUG_Append_All(‘ ”
This is what’s written in the messege of the arror.
Line 177: $as = $html->find(‘a’);
Could you please help me with it. If it’s possible!
Hi Pavel,
If you are not using the Append URL feature, disable it and it will work. But if you are using it, please join our slack channel so i can send you patch. https://www.haktansuren.com/slack-handlwp/
Thanks for your answer, but i dont know what’s “Append URL feature” and where can i disable it. I would be very thankfull if you explain me this
Go to Settings > HandL UTM Grabber and make sure “Append UTM” is unchecked.
Hi Hakan,
i just find out about your amazing plugin
please can you tell me how to create one article which can be changed depend on the traffic source
for example, if the traffic is from facebook i can hide certain paragraph and so on:
if you have any plugin or service any idea
please tell me
thank you
Please join our Slack channel so we can discuss the requirement there https://www.haktansuren.com/slack-handlwp/
In WPForms the hidden input its created inside a Div where you can add the class, so I made this quick code to pass the value to the input, easy:
(function($) {
$(document).ready(function() {
var varUtmSource = handl_utm[‘utm_source’];
var varUtmMedium = handl_utm[‘utm_medium’];
var varUtmCampaign = handl_utm[‘utm_campaign’];
var varUtmTerm = handl_utm[‘utm_term’];
var varUtmContent = handl_utm[‘utm_content’];
$(“.utm_source”).find(‘input:hidden’).val(varUtmSource);
$(“.utm_medium”).find(‘input:hidden’).val(varUtmMedium);
$(“.utm_campaign”).find(‘input:hidden’).val(varUtmCampaign);
$(“.utm_term”).find(‘input:hidden’).val(varUtmTerm);
$(“.utm_content”).find(‘input:hidden’).val(varUtmContent);
});
})(jQuery);
Yeap, it is smart. Thanks for sharing.
Great plugin mate!, love it.
This plugin is throwing php warnings. Are you planning to update the plugin anytime soon?
Can you share more about the warning? where do you see the warning and what kind of warning message?
When I use the shortcode in cformsII is just posts the shortcode to my CRM not the intended variable. Any idea how to make it work?
Please join our slack channel https://www.haktansuren.com/slack-handlwp/ and give me more details to investigate.
Hi,
I’m using contact form7.
I am using a tracking template that comes with Google Ads and would like to capture these parameters on all the links.
co.uk/?keyword=the%20keyword%20here&matchtype=b&adposition=1t2&device=m&gclid=Cj0KCQiAmZDxBRDIARIsABnkbYR3b-bodwRvJQdePmjH4Tg50ejC-NpDGgRE5TInmPFRY27HlxYJSHEaAuC4EALw_wcB
Please join our slack channel to give more details about the problem https://www.haktansuren.com/slack-handlwp/
Great plugin for capturing UTMs, but even better support. Haktan is the real deal. Donate generously guys 🙂
Hello Developer,
I have used your plugin for cf7 forms, but it is showing null fields and undefined and empty fields , I have tested for all social media platform but still it is not working.
How to solve this issue.
Please join our slack channel to give more details about the problem https://www.haktansuren.com/slack-handlwp/
Hello Haktan!
Thanks for this great plugin but the shortcodes are not working for me:
https://skystl.com/custom-outdoor-cushions-lp/?utm_campaign=xxxx&utm_source=xxxx&utm_medium=xxxx&utm_adgroup=xxxx&utm_keyword=xxxx&utm_term=txxxx&utm_content=xxxx&creative=xxxx&device=xxxx&match_type=xxxx
This is my url with the utms
This is my link:
https://skystl.com/food-beverage-service-flags-lp/?utm_campaign=%5Butm_campaign%5D&utm_source=%5Butm_source%5D&utm_medium=%5Butm_medium%5D&utm_adgroup=%5Butm_adgroup%5D&utm_keyword=%5Butm_keyword%5D&utm_term=%5Butm_term%5D&utm_content=%5Butm_content%5D&creative=%5Bcreative%5D&device=%5Bdevice%5D&match_type=%5Bmatch_type%5D
I am not using the Append UTM function.
Use FLAGS (circle image) at the bottom of page to test link with shortcodes.
As you can see, the utm parameters are not being saved.
shortcodes are not showing but it looks like this: https://screencast.com/t/DjGM8RYC
Yes you need to use the wrapper version not shortcodes. See here: https://wordpress.org/support/topic/shortcodes-wont-work-in-link/
What would I have to do in order for this program to replace utm_content or other parameter assigned as a class or id to a div, span, or other tag to replace it with the name in the url! This would allow me to switch out content on my site dynamically. Dang.
So I say content here then the utm_content is replaced with the name in the url. Possible?
HandL UTM Grabber works out of the box using name field to fill the utm_variables. Please see the hassle free implementation part of the article.
Its great that the app can add a vlue to an input field when “id=utm_” However, I am suggesting that it replace the value of “utm_” in such case with the utm value itself. So if I add id=”utm_souce” to a div, then when the page is rendered, it changes to id=”somevalueforutmsource”
Thoughts?
hmm i think i understand what you meant… Glanced back to your original question, you said you want to change the content on your site dynamically. Maybe this should help accomplishing that https://wordpress.org/plugins/handl-hide-content/?
Great tool! I’ve used it on CF7 easily. Now the tricky one, I have a theme that has it’s own contact form which is in all pages. How can I track those in an email result?
Theme is Enfold.
I am not familiar with that theme, maybe join our slack channel so i can give better suggestion https://www.haktansuren.com/slack-handlwp/
if you are using contact form7
you have to insert tags like this into the Form code
[hidden utm_source default:get]
[hidden utm_campaign default:get]
[hidden utm_medium default:get]
and its work!
Well, it works ONLY when the UTMs are in the URL. It does not work when they are in the COOKIE. I still recommend my way of implementation over this.
1 [handl_original_ref] – The URL from which the user came to your site
2 [handl_landing_page] – The very first page the user visited on your site.
1 and 2 have the same values. Always.
I need only URL from which the user came to your site, not 1h or 1 d ago, just per 1 session. How to do it?
Normally, they should result different values.
[handl_original_ref] should work on your case. Incase you are having problem, maybe the originated website prevents sending the referrals to target website. It needs to be investigated.
I’m having the same issue. I have a website that when I go from Google -> Website Homepage -> Contact Form Page, then submit a form, [handl_original_ref] is my homepage URL, not google.com.
If I have my contact form on the homepage, it properly shows google.com as the referrer.
Hey, I have just installed your plugin and this can really help me in tracking my campaigns well at the user level.
I want to append my UTM variables to all URLs (and not just the landing page) and I have checked in the option ‘Append UTM variables to all the links automatically (BETA)’.
But when I move from a landing page (homepage in this case) to another page on the website the UTM parameters are not being appended and they disappear.
Please join our Slack channel so we can talk more there https://www.haktansuren.com/slack-handlwp/
Hello,
I’m Werner from BikerSOS. You made a special Handl UTM Grabber version for us 2 years ago I think.
I cant find the plugin and we move to a new website and we need the plugin again.
Sadly I cannot find the communication between us, so I’m not sure what we changed exactly in this version.
Maybe you can look in your Mails or Plugin Repository, if you find our version?
kind regards
Werner
Such a Great Plugin! Thanks!
Is is possible to set cookie expiration to 1 day instead of 1 month?
Yes I would need this too
Or perhaps just session based
Hi!
in woocomerce when go to checkout, utms disappear. In the rest of the site, works perfect.
disappear from where? cookies should always be there throughout.
After pay, in the check out order received page.
can you ping me via Slack, so i can help better https://www.haktansuren.com/slack-handlwp/
Hi there!
I have a wordpress page with an HTML coded form which I couldn’t implement with CF7 or any other.
I’m having trouble appending the UTMs to the “thank you page” after the user hits submits. I’ve tried copying and pasting the codes in the description of this post without sucess. Any chance I could get some help?
Note the utms should go where “UTMSSHOULDCOMEHERE” is written.
Any help would be appreciated
Hi there!
I have a wordpress page with an HTML coded form which I couldn’t implement with CF7 or any other.
I’m having trouble appending the UTMs to the “thank you page” after the user hits submits. I’ve tried copying and pasting the codes in the description of this post without sucess. Any chance I could get some help?
Note the utms should go where “UTMSSHOULDCOMEHERE” is written.
Any help would be appreciated
Hi there!
I have a wordpress page with an HTML coded form which I couldn’t implement with CF7 or any other.
I’m having trouble appending the UTMs to the “thank you page” after the user hits submits. I’ve tried copying and pasting the codes in the description of this post without sucess. Any chance I could get some help?
Html code below without de “” to not break anything
form action=”https://yalo.com.br/campanhavivo/cadastro-cliente-corporativo-vivo/contato-solicitado-com-sucessoUTMSSHOULDCOMEHERE” method=”post” id=”contratoPJ” class=”fomrPJ”
Note the utms should go where “UTMSSHOULDCOMEHERE” is written.
Any help would be appreciated
why do you need the UTMs appended to thank you page URL?
Seems to me that if a utm_campaign is stored as a cookie, then when a new utm_campaign is added to a url, the former cookie should be deleted. Currently the second utm, does not override the first
Yes it should overwrite. Can you share the URL where this does not happen?
Unfortunately, I’m now using another module – I did try to change the expiry date in the code, but only in one of the places, perhaps this is the reason
which module/plugin are you using? Philip
UTM Tracker: https://wordpress.org/plugins/utm-tracker/
This is not my plugin. This is my plugin https://wordpress.org/plugins/handl-utm-grabber/
I have tried your module again – what I am finding is that it works the first time, populates a hidden input on one of my pages. Then if I test using a different utm value, the old one is stuck in the source code and does not populate the hidden field anew with anything http://www.villagewater.org
Sounds like you are having cache problem. Are you hosted on WP Engine?
Hosted on a godaddy ‘WP managed server’
Hi Philip, Can you join our Slack channel so i can help you better there? https://www.haktansuren.com/slack-handlwp/
Is posible to change the expiration time of the cookie? I checked the code and I saw:
time()+60*60*24*30
I would like to set 7 days.
thanks
Not out of the box (in UI). But if you dig down in the code, there are two places you need to make the changes. It is very easy.
great thanks. another questions. if you do changes in the plugin code, when someone update the plugin, the changes in the time will be replaced?
thanks
great thanks. another questions. if you do changes in the plugin code, when someone update the plugin, the changes in the time will be replaced?
thanks
Yes, either do not update, or apply the changes right after the update.
I had to disable the “Append UTM variables to all the links automatically (BETA)” It was adding a ? question mark to my anchors, making the page reload every time.
Thanks for reporting Erika. That feature is only helpful for multi domain traffic anyway. You probably would not need it.
Hi, I really need some help with this plugin right now. I’ve got an angry client going crazy, needing this to work, so I’ll really appreciate any help you can give.
I’ve installed this plugin for Ninja Forms, which you described here: https://www.haktansuren.com/handl-utm-grabber-integrations/#ninja-forms
I’ve added the fields to my hidden form like so: UTM-source: {handl:utm_source}, UTM-medium: {handl:utm_medium}, UTM-term: {handl:utm_term}, UTM-content: {handl:utm_content}, UTM-campaign: {handl:utm_campaign}
However, when I fill out a form on a UTM URL, the email I get shows all UTM fields empty. I tried shortening my hidden form to just have ‘{handl:utm_source}’, to see if it would capture just one of the values, but no luck.
Nothing seems to work. Do you have any suggestions for what might be going wrong here? Is there an error log I can find somewhere to tell me what’s going wrong?
could be cache-related? Join our Slack channel so i can help better https://www.haktansuren.com/slack-handlwp/
That’s a good question, I’m not sure. You mean WordPress cache right? I’ve cleared my browser cache and used incognito mode so that shouldn’t be the issue, if you’re referring to my local browser cache. I’ll try to join your Slack server here.
Hi Haktan, I’m looking to make sure my UTMs are forwarded to external domains and I’ve seen you have a code for that (below)
<a href="www.destinationURL.com?utm_campaign=[utm_campaign]&utm_source=[utm_source]&utm_term=[utm_term]&utm_content=[utm_content]&gclid=[gclid]">Click Here To Go >>> </a>
Question is, where do I put it?
I use Elementor and have no coding skills, is there somewhere I can paste this code?
Thanks,
Oscar
Hello Haktan,
I hope you are well. Do you know if the plugin complies with EU GDPR?
I have a popup that blocks GA cookies, so those are not stored with the user. But the UTM plugin bypasses my pop up and still stores the cookies. I am using the https://www.iubenda.com/ cookie content.
I look forward to your reply.
Thanks
Hey Alex,
it is not GDPR compliance right now, but planning to release a premium version soon which will comply with EU GDPR.
Hi Haktan,
I’ve posted a question before, but this is a new one.
I have a source which I can’t change its name: “utm_source=RD+Station”. What happens is, when the user hits my wordpress, it replaces it with “RD%20Station”.
The problem: when I click any internal wordpress link the UTMs stay put as expected (RD%20Station followed by all the other utms). When I click to get to another webpage inside the same domain, but not in the wordpress sctructurethe utms after “%20” vanishes.
To see this in action please check this link and click in any of the “Assinar agora” at the bottom table.
https://yalo.com.br/?utm_source=RD+Station&utm_medium=email&utm_campaign=al_drc_ca1_semhtml
After you click “Assinar agora” you will realize the link will be shortened to
https://yalo.com.br/loja/yalo/beneficiario?assinatura=vida&utm_source=RD
Would you know if this is something your plugin would need to fix or if it is something else?
I followed the steps but for me it is not truncated, see the image (bottom of the image – full hyper link)
https://i.imgur.com/2inhFGd.png
Hi Haktan,
Would it be possible to implement an additional feature in this plugin to add custom URL parameters?
Example: I need to pass the parameter “xcod” forward, but the plugin “only” passes “utm’s” and “gclid”.
Is there any possibility to implement this or suggest a solution to pass an additional parameter forward?
Best regards,
Charles
Hi Haktan,
I am trying to use your plugin with elementor forms, but it doesn’t work (I put the label/attribute names as you requested).
It does not automagically fill the entry with the utm codes.
Would you be able to solve this issue?
Thanks!
Sure, DM me via https://www.haktansuren.com/slack-handlwp/ so i can help you there.
Hi Haktan,
I’m having an issue with getting the plugin:
I’ve added the plugin to our page and used the hidden fields in Gravity Forms to track where our leads come from. It works perfectly when I tested it by putting the UTM tag directly in the URL but the traffic coming in from our Facebook ads (or any facebook link) isn’t pulling in that data. We suspect this is especially true for mobile users.
I’ve feel like I’ve read a million forums and blogs and I got nothing. Is anyone else experiencing something similar?
Thanks
Hi Siobhan,
Can you talk about how you are implementing the plugin, are you using the cookies? or query args? Maybe join our slack channel and we can discuss there lengthly https://www.haktansuren.com/slack-handlwp/
Hi Haktan,
Thanks for a really good plugin, this is very useful for me.
I wanted to ask if its possible to implement my own variable to be displayed in the contact form 7 message?
For example: ?ref=XXX
I can’t use UTM-variables for a particular reason that is unnecessary to explain.
up this, I’m interested in the same thing! Thank you
Not with the current version however I’m releasing the pro version of the plugin where you will be able to collect ANY params very soon.
Not with the current version however I’m releasing the pro version of the plugin where you will be able to collect ANY params very soon.
I’m trying to integrate this into Formassembly, i’ve tried wrapping it with the [gclid] but it doesn’t seem to take it. Any other way this could work?
Can you link me to the page where you are testing this? You are welcome to join the community where you can DM me directly https://www.haktansuren.com/slack-handlwp/
HI Haktan,
I am unable to figure out, how to use Handl UTM grabber with Ultimate Membership registration forms.
Will appreciate the help.
THANKS
I’m not familiar with the ultimate membership plugin, however if you can show me how it works i might give you some ideas. Feel free to join our Slack channel https://www.haktansuren.com/slack-handlwp/ to discuss more.
Yes, our developers have ideas regarding the ultimate membership plugin. You can feel free to connect with us anytime.
HandL UTM Grabber V3 integrates with Ultimate Membership. Consider upgrading to latest here https://handldigital.com/utm-grabber/ and follow the step-by-step documentation here to capture UTMs in Ultimate Membership https://handldigital.com/utm-grabber/documentation/public/books/ultimate-member-integration/page/passing-utm-variables-to-new-registration-admin-email-template
Hi, I am using elementor, and trying do use the UTMs in the buttons links. I am using ?utm_campaign=[utm_campaign]&utm_source=[utm_source]&utm_content=[utm_content], but it is not working. I have tried [[utm]] also, and did not work. How can I use the shortcodes in elementor buttons?
Hi there !
does the plugin works with Cognito forms ?
thank you !
You can use the prefill functionality shown here https://www.cognitoforms.com/support/65/data-integration/prefilling-a-form for the UTM fields
Cognito.load(“forms”, { id: “2”, entry: { “Utmcampaign”: “[utm_campaign]“} });
Hi! Thank you sfor this amazing plugin.
However, clicking on phone numbers that suppose to be opening up the dialer, are also added the utm string, which makes the number un-callable.
Is there any way to exclude phone number clicks?
Thanks!
Good point, I’ll fix this in the next release of V2. Btw, we do not actively support V2 any more, so it may take a while before we release the new version including this fix. You can consider upgrading to V3 (via https://handldigital.com/utm-grabber) if you need immediate help with this.
Bump on this. You can’t enable URLs adding automatically for phone numbers because it makes it a long wacky number.
Thanks for confirming Matt, this is already in the dev cycle, we’ll take care of this in future and implement in the FREE version. Please be on the lookout.
im using [handl_original_ref]
but it gives me the page i was in mysite and not the url i was before entering the site
Hi Ofir,
There could be two reasons
1-) Maybe you are testing without resetting your cookies. So you keep getting the same values from your previous test. handl_original_ref is only recorded once and never gets updated in the COOKIES. So, if you are testing different scenarios, you need to purge your cookies.
2-) The referrer site might be masking to send out referrer information.
Btw, if you are trying to capture organic data (like Google, Bing etc), then FREE version would not work. You need to upgrade it to the premium version https://utmgrabber.com/
Its happaning when i move back and forword in the site
when im comming from facebook its giving me the facebook link and when im enter anotehr page in the website and the click again to the contact page its changing to the page url and not staying facebook url
here is the link to the contact page
it not hidden field so you can see
http://a99103-tmp.s159.upress.link/%d7%a6%d7%95%d7%a8-%d7%a7%d7%a9%d7%a8/
Hi Haktan , did you see the problem ?
I think you have another problem, your server returns “priority-academy.co.il” as the main domain and it fails to register the cookies.
https://imgur.com/3nfOsVI
In cases like this, we recommend upgrading to V3 where you can lock the domain for the cookies.
Good work!
For us Nnt working when you enter into a post from the /blog page and in the logo header image
Hi David,
Thanks for the feedback!
Can you ping me the URL you are testing with? Btw, we have improved the append UTM logic greatly in V3. You are welcome to check it out here https://utmgrabber.com/
works great!!!
Thanks for the feedback Brandon, Please review the plugin here if you are liking it https://wordpress.org/plugins/handl-utm-grabber/#reviews
This plugin is AWESOME!!
Just curious to know if we can store the contact form 7 form fields, like – first name, last name, email, etc. in the cookie and when the same person visits the website again, the form is prefilled with his info.
Hi Susheel,
This can only be done doing some custom changes in the plugin. Btw, please review the plugin here if you are liking it https://wordpress.org/plugins/handl-utm-grabber/#reviews
Hi Haktan,
I had already reviewed 🙂
https://wordpress.org/support/topic/excellent-plugin-5854/
Can you please help with the below query:
When I pass any field with a ‘space’ between words and then append the variables in the URL after contact form 7 submission then the repose I receive replace the ‘space’ with ‘+’ sign.
Example:
Source Name = Susheel Seth
After submit -> redirect to http://www.example.com?utm_source=Susheel%20Seth
Admin email receive like this below:
UTM Source = Susheel+Seth
Please help in resolving this issue or a way to fix this.
Btw Happy New year in advance 🙂
Hi Susheel,
Thanks for the review. We fixed some of those problems on V3 of the plugin. Please send me the URL you are testing, i might be able to tell you why it is adding the `+`. Feel free to reach out to me via Slack too https://www.haktansuren.com/slack-handlwp/
Hello Haktan,
I have joined slack.
Hi Haktan,
Can you please help with the below query:
When I pass any field with a ‘space’ between words and then append the variables in the URL after contact form 7 submission then the repose I receive replace the ‘space’ with ‘+’ sign.
Example:
Source Name = Susheel Seth
After submit -> redirect to http://www.example.com?utm_source=Susheel%20Seth
Admin email receive like this below:
UTM Source = Susheel+Seth
Please help in resolving this issue or a way to fix this.
I think that spaces are not allowed in UTM
Hello, I am very happy with this plugin, but I encountered a problem when using it with WooCommervce. I tried it on my website staging, all utm is recorded well, but when I deploy to production site, utm is not recorded on the checkout page. Do you have any other solutions regarding this?
Hi Angga,
can you send me the URL? you can DM me in Slack too.
Hi,
I want to append all parameters with your Beta-Feature.
My URL is blog.transferxl.com
It works fine with all Links in the content, but not in the Header, Footer and Navigation.
Is that a problem of the theme you can’t fix?
Hi,
I use your new feature to append the get parameters.
In the content it works, but not in the Header, Menu and related articles.
I thing that this is an issue with the theme.
Can you confirm that?
Can you give me a short code? Maybe a can add that to the logo the navigation and so on.
Hi Thomas,
You can append UTMs using our class variable, see it here https://handldigital.com/utm-grabber/documentation/public/books/102-getting-started-for-handl-utm-grabber-v3/page/appending-utms-to-the-buttons-using-class-name-attributes-selectively
Hi, I have the same problem of Thomas. I have a site with wordpress and elementor as page builder. When I try the following guide (https://handldigital.com/utm-grabber/documentation/public/books/102-getting-started-for-handl-utm-grabber-v3/page/appending-utms-to-the-buttons-using-class-name-attributes-selectively)the button pass the UTMs, but instaed of redirect to the link I want, it simply reload the page.
Current Version of Handl UTM Grabber: 2.7.18
Hello Haktan!
I’m using your new feature to automatically append the UTMs parameters. In the content section it works, but not in some buttons of the Header and in the logo image.
I have a site with wordpress and elementor as page builder. When I try the following guide (https://handldigital.com/utm-grabber/documentation/public/books/102-getting-started-for-handl-utm-grabber-v3/page/appending-utms-to-the-buttons-using-class-name-attributes-selectively) the button pass the UTMs, but instaed of redirect to the link I want, it simply reload the page. Could you help me?
Hi Fabio,
Can you provide me link for your page to test please?
Thanks,
Haktan
append utm to url’s doesnt work in a footer
Hi Dave,
Thanks for the feedback, yes it is hard to make it work everywhere as not all the themes follow the standard practices in WP. Can you tell me which template are you using?
Hi Dave,
Sometimes Append URL works on some pages and sometimes it is not. I have a page that gave an error with the link. is there is anyway to fix that.
Hi Dave,
THE append URL is not working with me on all pages. and I realized that it only works when Source, medium and campaign is part of the UTM.
I missed this question because you addressed to someone else :). Are you still having trouble with this? Sounds like it is what Append UTMs is supposed to be doing.
Dear Haktan,
We started using your plugin a few weeks ago to track the source, medium, campaign, AG and KW of the leads generated by LinkedIn and Google Ads SEM campaigns. I am tracking the SEM campaigns with the following Final URL suffix, which I placed at the account level settings:
utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_content={adgroupid}&utm_term={keyword}&gclid={gclid}
I have enabled auto-tagging in Google Ads. Besides, in Universal Analytics I allowed manual tagging (UTM values) to override auto-tagging (GCLID values) for Google Ads. The website is on wordpress and uses CF7 forms.
Since we turned on the campaigns with the handl-utm-grabber, about 30% of the leads come with info on the source, medium and campaign that do not match with what I get from Analytics and Google Ads. I guess that this is in part due to the different attribution models, given that Analytics is last click and I have Google Ads set as position-based.
My understating is that handl-utm-grabber works as a sort of “last paid click” (with UTMs embedded), isn’t it? That is, if within 30 days a user comes 1st through an organic search, then a 2nd session from SEM campaign X from GAds, then comes back through an organic search, then returns through campaign Y from GAds and finally converts the lead in a 5th session started in Direct, the form will come with tracking info from campaign Y, right? And only if none of the sessions started with a paid click the form would come empty, right? (provided that all happens within the 30 days time frame and all paid clicks have their UTMs properly set). Thanks for confirming this point.
The thing is, it seems that in addition to these different attribution models, there might be something else going on, because at least in half of the cases where there are discrepancies, the values reported by handl-utm-grabber seem to be blatantly wrong — or at least they seem to make little sense. E.g. I have different campaigns for each continent, and sometimes a lead that both Analytics and GAds identify coming from a European country, handl-utm-grabber attributes it to an African or an Asian campaign that had zero impressions in that country, and vice-versa.
I read above in older comments that other handl-utm-grabber users had some issues with empty UTMs, such that whenever there was no UTM parameter in the URL, the plugin would still forward the LAST UTM used by another user in a different device and location. Could this be my case too? What would be the best way to proceed? We are using WP Rocket, in case you wonder.
Thanks in advance for the guidance, and apologies for the long note.
Dear Haktan,
My understating is that handl-utm-grabber works as a sort of “last paid click”, isn’t it? That is, if within 30 days a user comes 1st through an organic search, then a 2nd session from SEM campaign X from GAds, then comes back through an organic search, then returns through campaign Y from GAds and finally converts the lead in a 5th session started in Direct, the form will come with tracking info from campaign Y, right? And only if none of the sessions started with a paid click the form would come empty, right? (provided that all happens within the 30 days time frame and all paid clicks have their UTMs properly set).
Thanks for confirming this point.
Hi Marcos,
Yes handl utm grabber works as last attribution only. I strongly recommend you to upgrade to V3 where you can also capture first attribution as well. Since your usage of the plugin is advanced, V3 will work you better. We have specific requirements for WP Rocket as well, after you upgrade, get in touch with the support and they should be help you out https://utmgrabber.com/
Hello Haktan,
We have been using your plugin successfully on our website.
We have just noticed however that the full details of the UTM grabber parameters are added to the bottom of New Customer receipts when customers make a purchase on our woocommerce store.
Can you advise on how to remove?
Many Thanks
Hi Pete,
I think you must be on V3 of the plugin. You can comment out the line from wp-content/plugins/handl-utm-grabber-v3/premiums/woocommerce.php:46
`//add_action( ‘woocommerce_email_order_meta’, ‘handl_add_order_meta_to_email’, 10, 3 );`
Btw, you can get instant support since you are on V3 via chat at https://www.utmgrabber.com/
Hello, We’re testing your plugin on this site, and the UTM is moving across some pages, but not all?
We’re using Version 2.7.19 form the WordPress Repository to test.
Any thoughts why it’s not showing on all pages? IE: The homepage where I first tested a utm_source upon repeat visit, and the Schedule Now page?
https://www.improveitusa.com
https://www.improveitusa.com/schedule-now/
Thank you for your help,
Jonathon
Our digital marketing agency built our web site, and used your “HandL UTM Grabber” plugin. It was working fine until recently. (GTMetrix performance in late April was like an “A” grade.) The web site is SoCalTMS.com
Now our web site performance is in the “E/D” grade, “43%-55%” performance score (again, using GTMetrix.) Our web site is on Pressable.com. A Pressable support person did some profiling and figured out that the “HandL UTM Grabber” plugin is what is hurting our performance and slowing down the time to first byte (TTFB.) If we deactivate “HandL UTM Grabber”, the performance of our web site jumps to “A” with 99% performance score. I tested this on our production site, but also got the same results on our staging site and Pressable got this on the clone of our site that they tested.
Here is what the Pressable person said specifically:
====================================================
I’ve completed the testing regarding the slow TTFB and Batcache not loading on the clone.
I found that the HandL UTM Grabber plugin is causing Batcache not to work, which in return is causing the high TTFB.
I’d suggest deactivating this plugin if its not needed. If it is a crucial plugin, I’d recommend reaching out to the plugin developers regarding the TTFB.
Here’s a test with HanL UTM Grabber deactivated:
https://www.webpagetest.org/result/210916_AiDcAW_fc00b567ea65684ad85116ce79ac02d8/
The Time To First Byte dropped considerably to 0.50 seconds from 2.31 seconds
====================================================
Note: Pressable.com provides three kinds of “caching”: A CDN service, an “Object Cache”, and something called a “batcache”.
Is there anything you can do to modify the plugin so that it doesn’t prevent Pressable’s batcache from loading, and in general so that we can keep using your plugin on our web site?
I currently have your plugin deactivated. Do you want me to re-Activate it so you can do some testing?
thanks
pat holmes
(I thought I posted this yesterday… Trying again)
The problem I’m having is that our WordPress site is hosted by Pressable.com, and “HandL UTM Grabber” is preventing Pressable’s batcache from loading. A Pressable support person figured this out.
Here is what Pressable’s support person told me today: “Hopefully the developer responds and can assist with the reason that plugin is invalidating the cache (likely using a cookie with a wp_ or wordpress_ prefix, and in that case, Batcache won’t load).”
Here is the comment I thought I posted yesterday on your web site:
Our digital marketing agency built our web site, and used your “HandL UTM Grabber” plugin. It was working fine until recently. (GTMetrix performance in late April was like an “A” grade.) The web site is SoCalTMS.com
Now our web site performance is in the “E/D” grade, “43%-55%” performance score (again, using GTMetrix.) Our web site is on Pressable.com. A Pressable support person did some profiling and figured out that the “HandL UTM Grabber” plugin is what is hurting our performance and slowing down the time to first byte (TTFB.) If we deactivate “HandL UTM Grabber”, the performance of our web site jumps to “A” with 99% performance score. I tested this on our production site, but also got the same results on our staging site and Pressable got this on the clone of our site that they tested.
Here is what the Pressable person said specifically:
====================================================
I’ve completed the testing regarding the slow TTFB and Batcache not loading on the clone.
I found that the HandL UTM Grabber plugin is causing Batcache not to work, which in return is causing the high TTFB.
I’d suggest deactivating this plugin if its not needed. If it is a crucial plugin, I’d recommend reaching out to the plugin developers regarding the TTFB.
Here’s a test with HanL UTM Grabber deactivated:
https://www.webpagetest.org/result/210916_AiDcAW_fc00b567ea65684ad85116ce79…
The Time To First Byte dropped considerably to 0.50 seconds from 2.31 seconds
====================================================
Note: Pressable.com provides three kinds of “caching”: A CDN service, an “Object Cache”, and something called a “batcache”.
Is there anything you can do to modify the plugin so that it doesn’t prevent Pressable’s batcache from loading, and in general so that we can keep using your plugin on our web site?
I currently have your plugin deactivated. Do you want me to re-Activate it so you can do some testing?
thanks
pat holmes
Hello!
We want to track our sales from our blog posts so we want to add UTM parameters to all internal links and catch them from GA3. Are we in the right place? Is your v3 right product?
Yes, that’s exactly what HandL UTM Grabber does. If you are using WooCommerce, you will see the captured parameters in order page too https://docs.utmgrabber.com/books/woocommerce-integration/page/collect-utms-in-woocommerce-orderpage
Hello! Firstly, great plugin. You rock!
However, I am experiencing a small issue. We have a podcast plugin using custom post type and now a /%22 is being added to the end of each podcast post url and causing a 404. Not sure where to look in our code to fix. Any help would be greatly appreciated. Thank you! 🙂
Here is the php:
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
function _get_ob($v){
ob_start();
$v;
return ob_get_clean();
}
register_activation_hook( __FILE__, 'add_podcast_fields' );
function add_podcast_fields () {
add_rewrite_rule('^download-podcast?', 'index.php?download-podcast=true', 'top');
flush_rewrite_rules();
}
add_action('init', 'init_podcast');
function init_podcast () {
add_podcast_fields();
add_filter('query_vars', 'register_query_var');
add_action('parse_query', 'podcast_actions');
$post_types = get_post_types();
if (!array_key_exists('podcast', $post_types)) {
$post_type_args = array(
'label' => 'Podcasts',
'public' => true,
'has_archive' => true,
'publicly_queryable' > true,
"show_ui" => true,
"show_in_rest" => true,
'query_var' => true,
'menu_position' => 5,
'name' => 'podcast',
'singular_label' => 'Podcast',
'add_new' => 'Add New Podcast',
'menu_name' => 'Podcasts',
'all_items' => 'All Podcsts',
'add_new' => 'Add New',
'add_new_item' => 'Add New Podcast',
'edit_item' => 'Edit Podcast',
'new_item' => 'New Podcast',
'view_item' => 'View Podcast',
'search_items' => 'Search Podcasts',
'not_found' => 'No Podcasts Found',
'not_found_in_trash' => 'No Podcasts found in trash',
'parent_item_colon' => 'Parent Podcast',
'capability_type' => 'post',
"rewrite" => [ "slug" => "trs_podcast", "with_front" => true ],
'supports' => array('title', 'editor', 'comments', 'thumbnail'),
'taxonomies' => ['category']
);
$post_type = register_post_type('mwod_podcast', $post_type_args);
}
if(function_exists("register_field_group")) {
register_field_group(array (
'id' => 'acf_podcast-details',
'title' => 'Podcast Details',
'fields' => array (
/* array (
'key' => 'field_58093777a89d0',
'label' => 'MP3',
'name' => 'podcast_mp3',
'type' => 'file',
'required' => 1,
'save_format' => 'object',
'library' => 'uploadedTo',
),
*/
array (
'key' => 'field_58093790a89d1',
'label' => 'Short Title',
'name' => 'podcast_short_title',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => 25,
),
array (
'key' => 'field_580937a8a89d2',
'label' => 'Short Subtitle',
'name' => 'podcast_short_subtitle',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => 36,
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'mwod_podcast',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
}
function register_query_var( $vars ) {
$vars[] = 'download-podcast';
return $vars;
}
function podcast_actions () {
global $wp;
if (!$wp->query_vars) {
return;
}
if (array_key_exists('download-podcast', $wp->query_vars)) {
$podcast_id = $_GET['podcast_id'];
if (!$podcast_id) {
http_response_code(400);
die();
}
$mp3_id = get_post_field('podcast_mp3', $podcast_id);
if (!$mp3_id) {
http_response_code(404);
die();
}
$uploads_path = wp_upload_dir()['basedir'];
$mp3_relative_path = get_post_meta($mp3_id, '_wp_attached_file', true);
$full_path = $uploads_path.'/'.$mp3_relative_path;
if ($fd = fopen ($full_path, "r")) {
$fsize = filesize($full_path);
$path_parts = pathinfo($full_path);
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
header("Content-length: $fsize");
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
fclose ($fd);
die();
}
http_response_code(404);
die();
}
}
add_shortcode('mwod_grid_content', 'show_posts');
function show_posts ($attrs, $content) {
if (!array_key_exists('post_type', $attrs)) {
return;
}
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$content .= '';
$query_params = array(
'post_type' => $attrs['post_type'],
'tax_query' => array($tax_query),
'meta_key' => 'date',
'orderby' => 'meta_value',
'order' => 'DSC',
'showposts'=>100
);
if (array_key_exists('categories', $attrs)) {
$query_params['category_name'] = $attrs['categories'];
}
$wp_query = new WP_Query($query_params);
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$date = get_post_field('date');
$date = $date != '' ? date('F j', strtotime($date)) : '';
$time=get_post_field('time');
$location=get_post_field('location');
$price=get_post_field('price');
$booking_url=get_post_field('booking_url');
$title = get_the_title();
$post_content = get_the_content();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
$detail_content = <<<DETAIL_CONTENT
$title
$location
$date $time
Price - $price
$post_content
Register Now
DETAIL_CONTENT;
$shortcode = do_shortcode('[lightbox id="'.$post->ID.'" padding="20px"]'.$detail_content.'[/lightbox]');
$content .= <<<CONTENT
$title
CONTENT;
if ($date) {
$content .= "$date";
}
if ($location) {
$content .= "$location";
}
$content .= <<<CONTENT
$shortcode
CONTENT;
}
$content .= '';
return $content;
}
add_shortcode('mwod_podcast_grid', 'show_podcasts');
function show_podcasts ($attrs, $content) {
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$user_logged_in = is_user_logged_in();
if (!$user_logged_in) {
$content .= do_shortcode('[lightbox id="signup" padding="20px"]Favoriting a podcast is available for members only. Start your free trial today to experience all of the benefits!Sign Up Now[/lightbox]');
}
$content .= '';
$content .= '';
$wp_query = new WP_Query(array(
'post_type' => 'mwod_podcast',
'orderby' => 'post_date',
'order' => 'ASC',
'showposts' => '200'
));
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$title = get_post_field('podcast_short_title') ?? get_the_title();
$subtitle = get_post_field('podcast_short_subtitle');
$post_permalink = get_permalink();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
// MP3 Details
$enclosureArray = get_post_meta($post->ID, 'enclosure', true);
$MetaParts = explode("\n", $enclosureArray, 4);
if( count($MetaParts) > 0 )
$mp3_url = $MetaParts[0];
$mp3_url = trim($mp3_url);
/*
// Favorited
$favorite_url = '#signup';
$favorite_icon = 'fa-plus-circle';
if ($user_logged_in) {
$favorite_action = 'add';
if (wpfp_check_favorited && wpfp_check_favorited($post->ID)) {
$favorite_action = 'remove';
$favorite_icon = 'fa-minus-circle';
}
$favorite_url = $post_permalink."?postid=$post->ID&ajax=1";
}
*/
$content .= <<<CONTENT
$title
$subtitle
Play
Download
Favorite
Comment
$shortcode
CONTENT;
}
$content .= '';
return $content;
}
add_shortcode('mwod_podcast_grid_category', 'show_podcasts_category');
function show_podcasts_category ($attrs, $content) {
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$user_logged_in = is_user_logged_in();
if (!$user_logged_in) {
$content .= do_shortcode('[lightbox id="signup" padding="20px"]Favoriting a podcast is available for members only. Start your free trial today to experience all of the benefits!Sign Up Now[/lightbox]');
}
$attr_keys = array_keys($attrs);
$content .= '';
$categories_in = in_array('categories',$attr_keys) && !empty($attrs['categories']) ? explode(',',$attrs['categories']) : [];
$args = array(
'taxonomy' => 'category',
'parent' => '1184',
'orderby' => 'name',
'order' => in_array('cat_order',$attr_keys)&&strtolower($attrs['cat_order'])!='asc'?'DESC':'ASC',
'hierarchical' => 1,
'hide_empty' => 0,
'pad_counts' => false
);
$categories = get_terms($args);
foreach ($categories as $cat) {
$get_items=0;
if(empty($categories_in)) $get_items=1;
else{
if(in_array($cat->term_id,$categories_in)) $get_items=1;
elseif(in_array($cat->slug,$categories_in)) $get_items=1;
elseif(in_array($cat->name,$categories_in)) $get_items=1;
}
if(!$get_items) continue;
$content .= ''.$cat->name.'';
$content .= do_shortcode(''.$cat->description.'');
$content .= '';
$wp_query = new WP_Query(array(
'post_type' => 'mwod_podcast',
'cat' => $cat->term_id,
'orderby' => 'post_date',
'order' => in_array('post_order',$attr_keys)&&strtolower($attrs['post_order'])!='asc'?'DESC':'ASC',
'showposts' => '200'
));
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$title = get_post_field('podcast_short_title') ?? get_the_title();
$subtitle = get_post_field('podcast_short_subtitle');
$post_permalink = get_permalink();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
// MP3 Details
$enclosureArray = get_post_meta($post->ID, 'enclosure', true);
$MetaParts = explode("\n", $enclosureArray, 4);
if( count($MetaParts) > 0 )
$mp3_url = $MetaParts[0];
$mp3_url = trim($mp3_url);
// Favorited
$favorite_url = '#signup';
$favorite_icon = 'fa-plus-circle';
if ($user_logged_in) {
$favorite_action = 'add';
if (function_exists('wpfp_check_favorited') && wpfp_check_favorited($post->ID)) {
$favorite_action = 'remove';
$favorite_icon = 'fa-minus-circle';
}
$favorite_url = $post_permalink."?postid=$post->ID&ajax=1";
}
$content .= '
'.$title.'
'.$subtitle.'
Play
Download
Favorite
Comment
'.$shortcode.'
';
}
$content .= '';
}
return $content;
}
function font_awesome() {
wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.0.13/css/all.css', null, '5.0.13' );
}
add_action('wp_enqueue_scripts', 'font_awesome');
if(!is_admin()){
add_action('init',function(){
if(strpos($_SERVER['REQUEST_URI'],'/mwod_podcast/')!==false){
wp_redirect(str_replace('/mwod_podcast/','/trs_podcast/',$_SERVER['REQUEST_URI']),301);
exit;
}
});
}
?>
Looks like my comment didn’t embed the code correctly. Trying again 🙂
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
function _get_ob($v){
ob_start();
$v;
return ob_get_clean();
}
register_activation_hook( __FILE__, 'add_podcast_fields' );
function add_podcast_fields () {
add_rewrite_rule('^download-podcast?', 'index.php?download-podcast=true', 'top');
flush_rewrite_rules();
}
add_action('init', 'init_podcast');
function init_podcast () {
add_podcast_fields();
add_filter('query_vars', 'register_query_var');
add_action('parse_query', 'podcast_actions');
$post_types = get_post_types();
if (!array_key_exists('podcast', $post_types)) {
$post_type_args = array(
'label' => 'Podcasts',
'public' => true,
'has_archive' => true,
'publicly_queryable' > true,
"show_ui" => true,
"show_in_rest" => true,
'query_var' => true,
'menu_position' => 5,
'name' => 'podcast',
'singular_label' => 'Podcast',
'add_new' => 'Add New Podcast',
'menu_name' => 'Podcasts',
'all_items' => 'All Podcsts',
'add_new' => 'Add New',
'add_new_item' => 'Add New Podcast',
'edit_item' => 'Edit Podcast',
'new_item' => 'New Podcast',
'view_item' => 'View Podcast',
'search_items' => 'Search Podcasts',
'not_found' => 'No Podcasts Found',
'not_found_in_trash' => 'No Podcasts found in trash',
'parent_item_colon' => 'Parent Podcast',
'capability_type' => 'post',
"rewrite" => [ "slug" => "trs_podcast", "with_front" => true ],
'supports' => array('title', 'editor', 'comments', 'thumbnail'),
'taxonomies' => ['category']
);
$post_type = register_post_type('mwod_podcast', $post_type_args);
}
if(function_exists("register_field_group")) {
register_field_group(array (
'id' => 'acf_podcast-details',
'title' => 'Podcast Details',
'fields' => array (
/* array (
'key' => 'field_58093777a89d0',
'label' => 'MP3',
'name' => 'podcast_mp3',
'type' => 'file',
'required' => 1,
'save_format' => 'object',
'library' => 'uploadedTo',
),
*/
array (
'key' => 'field_58093790a89d1',
'label' => 'Short Title',
'name' => 'podcast_short_title',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => 25,
),
array (
'key' => 'field_580937a8a89d2',
'label' => 'Short Subtitle',
'name' => 'podcast_short_subtitle',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => 36,
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'mwod_podcast',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
}
function register_query_var( $vars ) {
$vars[] = 'download-podcast';
return $vars;
}
function podcast_actions () {
global $wp;
if (!$wp->query_vars) {
return;
}
if (array_key_exists('download-podcast', $wp->query_vars)) {
$podcast_id = $_GET['podcast_id'];
if (!$podcast_id) {
http_response_code(400);
die();
}
$mp3_id = get_post_field('podcast_mp3', $podcast_id);
if (!$mp3_id) {
http_response_code(404);
die();
}
$uploads_path = wp_upload_dir()['basedir'];
$mp3_relative_path = get_post_meta($mp3_id, '_wp_attached_file', true);
$full_path = $uploads_path.'/'.$mp3_relative_path;
if ($fd = fopen ($full_path, "r")) {
$fsize = filesize($full_path);
$path_parts = pathinfo($full_path);
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
header("Content-length: $fsize");
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
fclose ($fd);
die();
}
http_response_code(404);
die();
}
}
add_shortcode('mwod_grid_content', 'show_posts');
function show_posts ($attrs, $content) {
if (!array_key_exists('post_type', $attrs)) {
return;
}
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$content .= '';
$query_params = array(
'post_type' => $attrs['post_type'],
'tax_query' => array($tax_query),
'meta_key' => 'date',
'orderby' => 'meta_value',
'order' => 'DSC',
'showposts'=>100
);
if (array_key_exists('categories', $attrs)) {
$query_params['category_name'] = $attrs['categories'];
}
$wp_query = new WP_Query($query_params);
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$date = get_post_field('date');
$date = $date != '' ? date('F j', strtotime($date)) : '';
$time=get_post_field('time');
$location=get_post_field('location');
$price=get_post_field('price');
$booking_url=get_post_field('booking_url');
$title = get_the_title();
$post_content = get_the_content();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
$detail_content = <<<DETAIL_CONTENT
$title
$location
$date $time
Price - $price
$post_content
Register Now
DETAIL_CONTENT;
$shortcode = do_shortcode('[lightbox id="'.$post->ID.'" padding="20px"]'.$detail_content.'[/lightbox]');
$content .= <<<CONTENT
$title
CONTENT;
if ($date) {
$content .= "$date";
}
if ($location) {
$content .= "$location";
}
$content .= <<<CONTENT
$shortcode
CONTENT;
}
$content .= '';
return $content;
}
add_shortcode('mwod_podcast_grid', 'show_podcasts');
function show_podcasts ($attrs, $content) {
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$user_logged_in = is_user_logged_in();
if (!$user_logged_in) {
$content .= do_shortcode('[lightbox id="signup" padding="20px"]Favoriting a podcast is available for members only. Start your free trial today to experience all of the benefits!Sign Up Now[/lightbox]');
}
$content .= '';
$content .= '';
$wp_query = new WP_Query(array(
'post_type' => 'mwod_podcast',
'orderby' => 'post_date',
'order' => 'ASC',
'showposts' => '200'
));
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$title = get_post_field('podcast_short_title') ?? get_the_title();
$subtitle = get_post_field('podcast_short_subtitle');
$post_permalink = get_permalink();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
// MP3 Details
$enclosureArray = get_post_meta($post->ID, 'enclosure', true);
$MetaParts = explode("\n", $enclosureArray, 4);
if( count($MetaParts) > 0 )
$mp3_url = $MetaParts[0];
$mp3_url = trim($mp3_url);
/*
// Favorited
$favorite_url = '#signup';
$favorite_icon = 'fa-plus-circle';
if ($user_logged_in) {
$favorite_action = 'add';
if (wpfp_check_favorited && wpfp_check_favorited($post->ID)) {
$favorite_action = 'remove';
$favorite_icon = 'fa-minus-circle';
}
$favorite_url = $post_permalink."?postid=$post->ID&ajax=1";
}
*/
$content .= <<<CONTENT
$title
$subtitle
Play
Download
Favorite
Comment
$shortcode
CONTENT;
}
$content .= '';
return $content;
}
add_shortcode('mwod_podcast_grid_category', 'show_podcasts_category');
function show_podcasts_category ($attrs, $content) {
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$user_logged_in = is_user_logged_in();
if (!$user_logged_in) {
$content .= do_shortcode('[lightbox id="signup" padding="20px"]Favoriting a podcast is available for members only. Start your free trial today to experience all of the benefits!Sign Up Now[/lightbox]');
}
$attr_keys = array_keys($attrs);
$content .= '';
$categories_in = in_array('categories',$attr_keys) && !empty($attrs['categories']) ? explode(',',$attrs['categories']) : [];
$args = array(
'taxonomy' => 'category',
'parent' => '1184',
'orderby' => 'name',
'order' => in_array('cat_order',$attr_keys)&&strtolower($attrs['cat_order'])!='asc'?'DESC':'ASC',
'hierarchical' => 1,
'hide_empty' => 0,
'pad_counts' => false
);
$categories = get_terms($args);
foreach ($categories as $cat) {
$get_items=0;
if(empty($categories_in)) $get_items=1;
else{
if(in_array($cat->term_id,$categories_in)) $get_items=1;
elseif(in_array($cat->slug,$categories_in)) $get_items=1;
elseif(in_array($cat->name,$categories_in)) $get_items=1;
}
if(!$get_items) continue;
$content .= ''.$cat->name.'';
$content .= do_shortcode(''.$cat->description.'');
$content .= '';
$wp_query = new WP_Query(array(
'post_type' => 'mwod_podcast',
'cat' => $cat->term_id,
'orderby' => 'post_date',
'order' => in_array('post_order',$attr_keys)&&strtolower($attrs['post_order'])!='asc'?'DESC':'ASC',
'showposts' => '200'
));
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$title = get_post_field('podcast_short_title') ?? get_the_title();
$subtitle = get_post_field('podcast_short_subtitle');
$post_permalink = get_permalink();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
// MP3 Details
$enclosureArray = get_post_meta($post->ID, 'enclosure', true);
$MetaParts = explode("\n", $enclosureArray, 4);
if( count($MetaParts) > 0 )
$mp3_url = $MetaParts[0];
$mp3_url = trim($mp3_url);
// Favorited
$favorite_url = '#signup';
$favorite_icon = 'fa-plus-circle';
if ($user_logged_in) {
$favorite_action = 'add';
if (function_exists('wpfp_check_favorited') && wpfp_check_favorited($post->ID)) {
$favorite_action = 'remove';
$favorite_icon = 'fa-minus-circle';
}
$favorite_url = $post_permalink."?postid=$post->ID&ajax=1";
}
$content .= '
'.$title.'
'.$subtitle.'
Play
Download
Favorite
Comment
'.$shortcode.'
';
}
$content .= '';
}
return $content;
}
function font_awesome() {
wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.0.13/css/all.css', null, '5.0.13' );
}
add_action('wp_enqueue_scripts', 'font_awesome');
if(!is_admin()){
add_action('init',function(){
if(strpos($_SERVER['REQUEST_URI'],'/mwod_podcast/')!==false){
wp_redirect(str_replace('/mwod_podcast/','/trs_podcast/',$_SERVER['REQUEST_URI']),301);
exit;
}
});
}
?>
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
function _get_ob($v){
ob_start();
$v;
return ob_get_clean();
}
register_activation_hook( __FILE__, 'add_podcast_fields' );
function add_podcast_fields () {
add_rewrite_rule('^download-podcast?', 'index.php?download-podcast=true', 'top');
flush_rewrite_rules();
}
add_action('init', 'init_podcast');
function init_podcast () {
add_podcast_fields();
add_filter('query_vars', 'register_query_var');
add_action('parse_query', 'podcast_actions');
$post_types = get_post_types();
if (!array_key_exists('podcast', $post_types)) {
$post_type_args = array(
'label' => 'Podcasts',
'public' => true,
'has_archive' => true,
'publicly_queryable' > true,
"show_ui" => true,
"show_in_rest" => true,
'query_var' => true,
'menu_position' => 5,
'name' => 'podcast',
'singular_label' => 'Podcast',
'add_new' => 'Add New Podcast',
'menu_name' => 'Podcasts',
'all_items' => 'All Podcsts',
'add_new' => 'Add New',
'add_new_item' => 'Add New Podcast',
'edit_item' => 'Edit Podcast',
'new_item' => 'New Podcast',
'view_item' => 'View Podcast',
'search_items' => 'Search Podcasts',
'not_found' => 'No Podcasts Found',
'not_found_in_trash' => 'No Podcasts found in trash',
'parent_item_colon' => 'Parent Podcast',
'capability_type' => 'post',
"rewrite" => [ "slug" => "trs_podcast", "with_front" => true ],
'supports' => array('title', 'editor', 'comments', 'thumbnail'),
'taxonomies' => ['category']
);
$post_type = register_post_type('mwod_podcast', $post_type_args);
}
if(function_exists("register_field_group")) {
register_field_group(array (
'id' => 'acf_podcast-details',
'title' => 'Podcast Details',
'fields' => array (
/* array (
'key' => 'field_58093777a89d0',
'label' => 'MP3',
'name' => 'podcast_mp3',
'type' => 'file',
'required' => 1,
'save_format' => 'object',
'library' => 'uploadedTo',
),
*/
array (
'key' => 'field_58093790a89d1',
'label' => 'Short Title',
'name' => 'podcast_short_title',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => 25,
),
array (
'key' => 'field_580937a8a89d2',
'label' => 'Short Subtitle',
'name' => 'podcast_short_subtitle',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => 36,
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'mwod_podcast',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
}
function register_query_var( $vars ) {
$vars[] = 'download-podcast';
return $vars;
}
function podcast_actions () {
global $wp;
if (!$wp->query_vars) {
return;
}
if (array_key_exists('download-podcast', $wp->query_vars)) {
$podcast_id = $_GET['podcast_id'];
if (!$podcast_id) {
http_response_code(400);
die();
}
$mp3_id = get_post_field('podcast_mp3', $podcast_id);
if (!$mp3_id) {
http_response_code(404);
die();
}
$uploads_path = wp_upload_dir()['basedir'];
$mp3_relative_path = get_post_meta($mp3_id, '_wp_attached_file', true);
$full_path = $uploads_path.'/'.$mp3_relative_path;
if ($fd = fopen ($full_path, "r")) {
$fsize = filesize($full_path);
$path_parts = pathinfo($full_path);
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
header("Content-length: $fsize");
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
fclose ($fd);
die();
}
http_response_code(404);
die();
}
}
add_shortcode('mwod_grid_content', 'show_posts');
function show_posts ($attrs, $content) {
if (!array_key_exists('post_type', $attrs)) {
return;
}
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$content .= '';
$query_params = array(
'post_type' => $attrs['post_type'],
'tax_query' => array($tax_query),
'meta_key' => 'date',
'orderby' => 'meta_value',
'order' => 'DSC',
'showposts'=>100
);
if (array_key_exists('categories', $attrs)) {
$query_params['category_name'] = $attrs['categories'];
}
$wp_query = new WP_Query($query_params);
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$date = get_post_field('date');
$date = $date != '' ? date('F j', strtotime($date)) : '';
$time=get_post_field('time');
$location=get_post_field('location');
$price=get_post_field('price');
$booking_url=get_post_field('booking_url');
$title = get_the_title();
$post_content = get_the_content();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
$detail_content = <<<DETAIL_CONTENT
$title
$location
$date $time
Price - $price
$post_content
Register Now
DETAIL_CONTENT;
$shortcode = do_shortcode('[lightbox id="'.$post->ID.'" padding="20px"]'.$detail_content.'[/lightbox]');
$content .= <<<CONTENT
$title
CONTENT;
if ($date) {
$content .= "$date";
}
if ($location) {
$content .= "$location";
}
$content .= <<<CONTENT
$shortcode
CONTENT;
}
$content .= '';
return $content;
}
add_shortcode('mwod_podcast_grid', 'show_podcasts');
function show_podcasts ($attrs, $content) {
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$user_logged_in = is_user_logged_in();
if (!$user_logged_in) {
$content .= do_shortcode('[lightbox id="signup" padding="20px"]Favoriting a podcast is available for members only. Start your free trial today to experience all of the benefits!Sign Up Now[/lightbox]');
}
$content .= '';
$content .= '';
$wp_query = new WP_Query(array(
'post_type' => 'mwod_podcast',
'orderby' => 'post_date',
'order' => 'ASC',
'showposts' => '200'
));
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$title = get_post_field('podcast_short_title') ?? get_the_title();
$subtitle = get_post_field('podcast_short_subtitle');
$post_permalink = get_permalink();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
// MP3 Details
$enclosureArray = get_post_meta($post->ID, 'enclosure', true);
$MetaParts = explode("\n", $enclosureArray, 4);
if( count($MetaParts) > 0 )
$mp3_url = $MetaParts[0];
$mp3_url = trim($mp3_url);
/*
// Favorited
$favorite_url = '#signup';
$favorite_icon = 'fa-plus-circle';
if ($user_logged_in) {
$favorite_action = 'add';
if (wpfp_check_favorited && wpfp_check_favorited($post->ID)) {
$favorite_action = 'remove';
$favorite_icon = 'fa-minus-circle';
}
$favorite_url = $post_permalink."?postid=$post->ID&ajax=1";
}
*/
$content .= <<<CONTENT
$title
$subtitle
Play
Download
Favorite
Comment
$shortcode
CONTENT;
}
$content .= '';
return $content;
}
add_shortcode('mwod_podcast_grid_category', 'show_podcasts_category');
function show_podcasts_category ($attrs, $content) {
wp_enqueue_style('podcasts-css', plugins_url('podcasts.css', __FILE__), null, null);
wp_enqueue_script('podcasts-js', plugins_url('podcasts.js', __FILE__), null, null);
$user_logged_in = is_user_logged_in();
if (!$user_logged_in) {
$content .= do_shortcode('[lightbox id="signup" padding="20px"]Favoriting a podcast is available for members only. Start your free trial today to experience all of the benefits!Sign Up Now[/lightbox]');
}
$attr_keys = array_keys($attrs);
$content .= '';
$categories_in = in_array('categories',$attr_keys) && !empty($attrs['categories']) ? explode(',',$attrs['categories']) : [];
$args = array(
'taxonomy' => 'category',
'parent' => '1184',
'orderby' => 'name',
'order' => in_array('cat_order',$attr_keys)&&strtolower($attrs['cat_order'])!='asc'?'DESC':'ASC',
'hierarchical' => 1,
'hide_empty' => 0,
'pad_counts' => false
);
$categories = get_terms($args);
foreach ($categories as $cat) {
$get_items=0;
if(empty($categories_in)) $get_items=1;
else{
if(in_array($cat->term_id,$categories_in)) $get_items=1;
elseif(in_array($cat->slug,$categories_in)) $get_items=1;
elseif(in_array($cat->name,$categories_in)) $get_items=1;
}
if(!$get_items) continue;
$content .= ''.$cat->name.'';
$content .= do_shortcode(''.$cat->description.'');
$content .= '';
$wp_query = new WP_Query(array(
'post_type' => 'mwod_podcast',
'cat' => $cat->term_id,
'orderby' => 'post_date',
'order' => in_array('post_order',$attr_keys)&&strtolower($attrs['post_order'])!='asc'?'DESC':'ASC',
'showposts' => '200'
));
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
$title = get_post_field('podcast_short_title') ?? get_the_title();
$subtitle = get_post_field('podcast_short_subtitle');
$post_permalink = get_permalink();
$background_image_url="/wp-content/uploads/2016/03/crossfit-breathe-fire.jpg";
if (has_post_thumbnail()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full-size');
$background_image_url = $image[0];
}
// MP3 Details
$enclosureArray = get_post_meta($post->ID, 'enclosure', true);
$MetaParts = explode("\n", $enclosureArray, 4);
if( count($MetaParts) > 0 )
$mp3_url = $MetaParts[0];
$mp3_url = trim($mp3_url);
// Favorited
$favorite_url = '#signup';
$favorite_icon = 'fa-plus-circle';
if ($user_logged_in) {
$favorite_action = 'add';
if (function_exists('wpfp_check_favorited') && wpfp_check_favorited($post->ID)) {
$favorite_action = 'remove';
$favorite_icon = 'fa-minus-circle';
}
$favorite_url = $post_permalink."?postid=$post->ID&ajax=1";
}
$content .= '
'.$title.'
'.$subtitle.'
Play
Download
Favorite
Comment
'.$shortcode.'
';
}
$content .= '';
}
return $content;
}
function font_awesome() {
wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.0.13/css/all.css', null, '5.0.13' );
}
add_action('wp_enqueue_scripts', 'font_awesome');
if(!is_admin()){
add_action('init',function(){
if(strpos($_SERVER['REQUEST_URI'],'/mwod_podcast/')!==false){
wp_redirect(str_replace('/mwod_podcast/','/trs_podcast/',$_SERVER['REQUEST_URI']),301);
exit;
}
});
}
?>
Hi Ryan,
Can you join our Slack channel and DM me there, it is impossible for me to read the code here 🙂
https://www.haktansuren.com/slack-handlwp/
Hi, the plugin works when I’m logged in wordpres as admin but is not working for normal users
Are you still having trouble with this Isai, if yes please consider joining our Slack channel here https://www.haktansuren.com/slack-handlwp/
Can’t login in my website anymore. Last friday I did. Now on Sunday inlog is a blanc page. The whole website is down. The last update plugin was HandL UTM Grabber (from version 2.7.20 to 2.7.21). Could the plugin crash my WordPress?
Is there a solution, I’m not technical, but maybe can hire some help.
Kind regards,
Rob
Hi Rob, yes there was a glitch on the previous version of the plugin. Get in touch with me via Slack https://www.haktansuren.com/slack-handlwp/. I’ll fix it for you.