josephtls
Forum Replies Created
-
Forum: Plugins
In reply to: [Yoast SEO] Meta descriptions only on 1st page of paginated contentAdd me to this list as well. I am also using the Yoast SEO plugin.
They work the same. It is just the name of the variable.
Right. I never meant to accuse you of any of that but rather was just making a statement. If you follow my code as I outlined it this solution will work for you.
That is fine, that is how I track my conversions and that is why this code is needed otherwise it is much simpler to just track in Analytics.
Once you set this up you must test your code. figure out your cheapest keyword in Adwords and then click on it in Google. From here fill out all 5 of your forms. (They will all count as a conversion through this one click). Never assume your code is working.
In your Contact 7 “Additional Settings” at the bottom of the page for each form you put the function you want to use. You use a different naming for each form you want to track and can name it whatever you want.
on_sent_ok: "Tracking1();"
on_sent_ok: "Tracking2();"
on_sent_ok: "Tracking3();"
on_sent_ok: "Tracking4();"
on_sent_ok: "Tracking5();"
But now you need to create a tracking.js file (or whatever you want to name it) and put the following code there five times changing the name and the tracking data provided by Google Adwords.
function Tracking(){ var img = document.createElement("img"); var goalId = 991793222; var randomNum = new Date().getMilliseconds(); var value = 0; var label = "_kaLCLzCzzQQ5KD22AM"; var url = encodeURI(location.href); var trackUrl = "https://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url; img.src = trackUrl; document.body.appendChild(img); }
function Tracking1(){ var img = document.createElement("img"); var goalId = 991793222; var randomNum = new Date().getMilliseconds(); var value = 0; var label = "_kaLCLzCzzQQ5KD22AM"; var url = encodeURI(location.href); var trackUrl = "https://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url; img.src = trackUrl; document.body.appendChild(img); }
and so on…
Once you have this done you simply need to include the .js file in your header.php.
<?php include ‘tracking.js’; ?>
header.php is called on every page of your website so this one include will work for your entire site.
My code does this for contact form 7. What I was asking for was your frustration with includes to set you up with that.
The ease of WordPress comes after you learn it. At that point you are thankful for the platform and functionality that is already there.
Can you explain more in detail what you are talking about and maybe I can explain how to do it for you in WordPress. Eventually you will find that WordPress is much more powerful and easy to use when compared to a static site.
Valid point, but not a reason to not start to learn PHP. I was literally in the same position as you are not too long ago but a simple search for “php header file include” will show you how simple this can actually be.
If you do not have an interest in actually learning find someone that can bill you at $X/hr for tasks that are beyond your skill set.
In this situation my practice is to put all related code in a separate file and call it as an include in the header. This way you can keep your code organized. Although some might argue that if a certain form is only on one page to only call the code you are needing for that specific page rather than your entire website through header.php
This example is for Google
Adwords conversion tracking.Add the following to your header.php
<script> function Tracking(){ var img = document.createElement("img"); var goalId = 991793222; var randomNum = new Date().getMilliseconds(); var value = 0; var label = "_kaLCLzCzzQQ5KD22AM"; var url = encodeURI(location.href); var trackUrl = "https://www.googleadservices.com/pagead/conversion/"+goalId+"/?random="+randomNum+"&value="+value+"&label="+label+"&guid=ON&script=0&url="+url; img.src = trackUrl; document.body.appendChild(img); } </script>
Next, add this to your Contact 7 “Additional Settings” at the bottom of the page.
on_sent_ok: "Tracking();"
Verify with Google Adwords conversions.
Done.
Note: Why do people go backwards to create a “Thank you” page in order to track conversions.
From the author of Contact 7 himself – “By the way, I’m often asked by users that how they can redirect to so-called “Thank You Page”. In most cases, they want to know it because they assume that redirecting to “Thank You Page” is necessary for tracking form submissions with Google Analytics. That’s not necessary at all. In fact, it’s an outdated and nonsense custom.”