HandL UTM Grabber: Capture UTMs on your forms

By Haktan Suren, PhD
In Bestof
Apr 10th, 2016
453 Comments
2037882 Views

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.

HandL UTM Grabber

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]]&utm_source=[[utm_source]]&utm_term=[[utm_term]]&utm_content=[[utm_content]]&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

About the Author

Haktan Suren, PhD
- Webguru, Programmer, Web developer, and Father :)

453 Responses to “HandL UTM Grabber: Capture UTMs on your forms”

  1. Nathan Faulkner says:

    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”

  2. Nathan Faulkner says:

    My previous comment was stripped of its code 🙁

  3. Lawrence says:

    Hi,

    Does this plugin store the utm details in cookies?

    Or will it only work when the URL features the various UTM parameter.

  4. 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?

    • Haktan Suren, PhD Haktan Suren says:

      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

      <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]" rel="nofollow">Click Here To Go >>> </a>
      

      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!

        • Haktan Suren, PhD Haktan Suren says:

          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!

          • Yasser says:

            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.

          • Haktan Suren, PhD Haktan Suren says:

            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.

          • Haktan Suren, PhD Haktan Suren says:

            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.

      • BikerSOS says:

        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?

        • Haktan Suren, PhD Haktan Suren says:

          Let me understand it right… You want to append UTMs to menu items only?

          • BikerSOS says:

            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

          • Haktan Suren, PhD Haktan Suren says:

            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.

          • Werner says:

            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.

          • BikerSOS says:

            No i use the default WordPress Menu within the Avada template in Design -> Menu

          • BikerSOS says:

            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

          • BikerSOS says:

            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

          • Haktan Suren, PhD Haktan Suren says:

            You seem to have some good questions, please consider joining our slack channel here https://www.haktansuren.com/slack-handlwp/ 🙂

  5. F2 Fitness says:

    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?

  6. Haktan Suren, PhD Haktan Suren says:

    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.

  7. horacio says:

    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 )

  8. Scott says:

    Is the new “every URL” feature fully implemented? Is it working?

    • Haktan Suren, PhD Haktan Suren says:

      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.

  9. Erik says:

    Hi, its only Working for me in the Article Text, not on Sidebar or Header and Footer.

  10. Sing says:

    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!

    • Haktan Suren, PhD Haktan Suren says:

      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!

  11. Alex says:

    Hi, Haktan!

    Is there Method to integrate your plugin into Woocommerce registration?

  12. Alex says:

    This really great idea, the thing all e-commerce shops need use

  13. 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

  14. Simon says:

    Great plugin, how do i add the shortcode to WooCommerce email order templates ?

    • Haktan Suren, PhD Haktan Suren says:

      Hi Simon, Not sure if WooCommerce allow shortcode on email order template, I will check it out and let you know soon…

    • Haktan Suren, PhD Haktan Suren says:

      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

       do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
      

      and add those just under

      $fields = array('utm_source','utm_medium','utm_term', 'utm_content', 'utm_campaign', 'gclid', 'handl_original_ref', 'handl_landing_page', 'handl_ip', 'handl_ref', 'handl_url');
      foreach ($fields as $id=>$field){
          print "$field: ".do_shortcode("[$field]")."<br>";
      }
      

      Way #2
      Create a plugin OR just add this into the function.php under your-theme/ folder

      add_filter('woocommerce_email_order_meta_fields', 'handl_utm_grabber_checkout_field_order_meta_fields', 10, 3 );
      function handl_utm_grabber_checkout_field_order_meta_fields( $fields, $sent_to_admin, $order ) {
          if ($sent_to_admin){
      	$fields = array('utm_source','utm_medium','utm_term', 'utm_content', 'utm_campaign', 'gclid', 'handl_original_ref', 'handl_landing_page', 'handl_ip', 'handl_ref', 'handl_url');
      	foreach ($fields as $id=>$field){
      		$fields['handl_'.$field] = array(
      			'label' => __( $field ),
      			'value' => do_shortcode("[$field]"),
      		);
      	}
          }
          return $fields;
      }
      

      Hope it is helpful for you. If you have any further question regarding this, join our slack channel here

  15. Scott Covert says:

    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]

    • Haktan Suren, PhD Haktan Suren says:

      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)”.

      <input type="hidden" name="utm_campaign">
      <input type="hidden" name="utm_source">
      <input type="hidden" name="utm_term">
      <input type="hidden" name="utm_medium">
      <input type="hidden" name="utm_content">
      <input type="hidden" name="gclid">
      • Scott Covert says:

        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?

        • Haktan Suren, PhD Haktan Suren says:

          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.

  16. Scott Covert says:

    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

  17. Puneet says:

    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.

  18. Patrick says:

    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 seeing https://businessadvising.geteverwise.com/roles/1/sign_up?utm_medium=utm_campaign

    Any idea what I’m doing incorrectly?

    • Patrick says:

      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]

      • Haktan Suren, PhD Haktan Suren says:

        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.

  19. Lane says:

    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.

  20. Eduardo says:

    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?

  21. yivgeni says:

    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)

  22. yivgeni says:

    ah! That explains it! Thank you very much

    This is such a great plugin 🙂

  23. Alan says:

    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” ?

    • Haktan Suren, PhD Haktan Suren says:

      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!

      • Alan says:

        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.

  24. Jay Akin says:

    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?

  25. Clare Wilson says:

    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

    • Haktan Suren, PhD Haktan Suren says:

      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.

  26. Lawrence says:

    Hi,

    How easy would it be to tweak the plugin so that and additional variable?

    For example, http://www.mysite.com?salute=hello

  27. Mark says:

    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.

  28. Mark says:

    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.

    • Haktan Suren, PhD Haktan Suren says:

      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

      add_filter( 'the_content', 'HUG_Append_All', 999 );

      , it is line 144 on latest version. Please let me know, Mark

      • Mark says:

        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.

      • Mark says:

        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?

  29. Maor says:

    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.

    • Haktan Suren, PhD Haktan Suren says:

      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!

  30. Mark Murnahan says:

    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

  31. dorian logan says:

    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.

    • Haktan Suren, PhD Haktan Suren says:

      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.

  32. kevin says:

    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.

  33. Denish says:

    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.

  34. 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

  35. johnpurcam says:

    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.

  36. Alan says:

    im trying to capture the gclid in gravity forms but not succes, any tutorial?

  37. Sam Kim says:

    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"];

  38. Alicia says:

    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?

  39. Greg Lamb says:

    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;
    }

  40. Mark says:

    Trying to switch phone numbers on site based on UTM Campaign

  41. Mark says:

    What would you charge to help?

  42. Mark says:

    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.

  43. Ashish Kumar says:

    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.

  44. 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

  45. Eduardo says:

    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!

    • Haktan Suren, PhD Haktan Suren says:

      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?

      • Eduardo says:

        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?

  46. Kevin says:

    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

    • Haktan Suren, PhD Haktan Suren says:

      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.

  47. Mike McPeak says:

    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?

    • Haktan Suren, PhD Haktan Suren says:

      I’ll reply the ticket as soon as i get the chance. Please check “HandL UTM Grabber” under Settings for “Append All” feature.

      • Mike McPeak says:

        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.

  48. Jimmy says:

    Is it possible for the plugin to store info about the referring source? More specifically if the visitor came from Organic Search or Direct?

  49. Mike McPeak says:

    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?

  50. Mike McPeak says:

    Yes, it is installed on this site, https://haletrailer.com. There is a contact form at https://haletrailer.com/locations/

    • Haktan Suren, PhD Haktan Suren says:

      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

      • Mike McPeak says:

        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.

  51. […] If you are not familiar with HandL UTM Grabber, or want to learn more about what you can capture, please visit this page. […]

  52. 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!

  53. Jose Antonio says:

    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

  54. Brandon says:

    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.

  55. Nazrin Noorzan says:

    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.

    • Haktan Suren, PhD Haktan Suren says:

      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?

  56. […] 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 […]

  57. Jon says:

    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.

    • Haktan Suren, PhD Haktan Suren says:

      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?

      • Jon says:

        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.

  58. nik says:

    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

  59. Nik says:

    Hi Haktan,

    Thanks for the reply. The site is: http://www.anthonymeindl.com

    Thanks again!
    N

  60. Ivan Dimitrov says:

    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?

  61. ibrahim ghandour says:

    Hi, do you do this grabber for drupal as well?

  62. andrea says:

    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)

  63. fb.com says:

    Hello, I enjoy reading through your article post.
    I like to write a little comment to support you.

  64. Tom says:

    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

  65. gurjeet says:

    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

  66. 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

  67. Raad says:

    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!

    • Haktan Suren, PhD Haktan Suren says:

      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?

  68. Divya Doshi says:

    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!

  69. Divya says:

    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

  70. Lionel says:

    Hi there,

    Could you add the new fbclid that Facebook launched last days?

    Best Regards

  71. Brian says:

    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!

  72. ian says:

    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

  73. Jose Pavia says:

    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?

  74. Jose Pavia says:

    Yes the server is using varnish and I think that is the issue

  75. 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

  76. 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

  77. MJ says:

    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?

    • Haktan Suren, PhD Haktan Suren says:

      What second plugin do you use to send it to CRM?

      • MJ says:

        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.

  78. Moore Owser says:

    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?

  79. Marcus Lucas says:

    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!!

    • Haktan Suren, PhD Haktan Suren says:

      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/

  80. Andre says:

    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?

  81. MJ says:

    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?

  82. 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.

  83. David says:

    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/

  84. Alexandra Hoon says:

    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!

  85. Charles LaRocca says:

    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)?

  86. Andre says:

    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.

  87. Cory says:

    Haktan,
    Do you know how to implement this in Caldera Forms?
    Thanks

  88. Ramiz Khan says:

    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

  89. Ramiz Khan says:

    hi, I’m getting %s as the value, how can I populate the value with the UTMs?

  90. Kenny says:

    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.

  91. Shawn says:

    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.

  92. Matt S says:

    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?

  93. Andrew Maury says:

    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?

  94. Brian Lester says:

    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!

  95. […] 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. […]

  96. aditya says:

    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

  97. Dale says:

    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!

  98. Brad Peterson says:

    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.

  99. Dale says:

    Sounds good! Submitted a screen recording on the Slack group.

    Thanks Haktan!

  100. Byron Spratt says:

    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

  101. Pavel says:

    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!

  102. mouad says:

    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

  103. 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);

  104. This plugin is throwing php warnings. Are you planning to update the plugin anytime soon?

  105. Saint says:

    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?

  106. dave says:

    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

  107. Joe Tuan says:

    Great plugin for capturing UTMs, but even better support. Haktan is the real deal. Donate generously guys 🙂

  108. Aditya says:

    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.

  109. Michael says:

    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?

  110. Safi says:

    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.

  111. Tong says:

    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!

  112. Sergio says:

    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?

    • Haktan Suren, PhD Haktan Suren says:

      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.

      • Drew says:

        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.

  113. Юрий says:

    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.

  114. 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

  115. Netanel says:

    Such a Great Plugin! Thanks!

  116. Erwan says:

    Is is possible to set cookie expiration to 1 day instead of 1 month?

  117. Max says:

    Hi!

    in woocomerce when go to checkout, utms disappear. In the rest of the site, works perfect.

  118. Oscar says:

    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

  119. Oscar says:

    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

  120. Oscar says:

    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

  121. 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

  122. Jose says:

    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

    • Haktan Suren, PhD Haktan Suren says:

      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.

      • Jose says:

        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

  123. Jose says:

    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

  124. erika says:

    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.

  125. George says:

    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?

  126. Oscar says:

    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]&amp;utm_source=[utm_source]&amp;utm_term=[utm_term]&amp;utm_content=[utm_content]&amp;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

  127. Alex says:

    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

  128. Oscar says:

    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?

  129. Charles says:

    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

  130. Matan says:

    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!

  131. Siobhan Lally says:

    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

  132. Daniel says:

    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.

  133. Chris Mollan says:

    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?

  134. Ahmad Afzal says:

    HI Haktan,

    I am unable to figure out, how to use Handl UTM grabber with Ultimate Membership registration forms.

    Will appreciate the help.

    THANKS

  135. Ashwin says:

    Yes, our developers have ideas regarding the ultimate membership plugin. You can feel free to connect with us anytime.

  136. 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?

  137. fdolin says:

    Hi there !
    does the plugin works with Cognito forms ?

    thank you !

  138. Maayan says:

    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!

  139. Ofir Leybovich says:

    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/

  140. David says:

    Good work!

    For us Nnt working when you enter into a post from the /blog page and in the logo header image

  141. Susheel says:

    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.

  142. Susheel Seth says:

    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.

  143. Angga Permana says:

    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?

  144. 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?

  145. 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.

  146. Fabio Amata says:

    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?

  147. 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?

  148. Mark says:

    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.

  149. Mark says:

    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.

  150. Marcos says:

    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.

  151. Marcos says:

    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/

  152. Pete says:

    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/

  153. 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

  154. 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

  155. (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

  156. Burak says:

    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?

  157. Ryan says:

    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;
    }
    });
    }
    ?>

  158. Ryan says:

    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;
    }
    });
    }
    ?>

  159. Ryan says:

    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;
    }
    });
    }
    ?>

  160. Isai says:

    Hi, the plugin works when I’m logged in wordpres as admin but is not working for normal users

  161. Rob says:

    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

Wrap your code in <code class="{language}"></code> tags to embed!

Leave a Reply

E-mail address is required for commenting. However, it won't be visible to other users.

Loading Facebook Comments ...
Loading Disqus Comments ...