-
AuthorPosts
-
April 19, 2017 at 10:32 pm #780185
Hi,
I need to add a script to every page of my site to track visitor behavior for my email marketing provider (Drip).
How do I go about that?
Where do I add the script? Is there somewhere where I place the snippet once and it’s detected on every page?
Maybe in the Google Analytics Code field within Enfold Theme Options? I have the Goolge tracking code and the remarketing code there already, not sure if it’s the right place and if so, where should I add it.
Thanks
April 19, 2017 at 10:36 pm #780187Hey Antonio,
You can add it into header.php right before the tag, or into the Google Analytics field.
Best regards,
Jordan ShannonApril 19, 2017 at 10:41 pm #780189Thanks for the prompt reply Jordan! Much appreciated.
I can add it in the Google Analytics field, since that won’t be overwritten like the headr.php file when Enfold updates, right?
Also, I already have a GA code within the Google Analyics field. It won’t affect anything if I add the other code underneath, right?
April 19, 2017 at 10:49 pm #780198Hi,
The GA field is not overwritten by updates and you can add them both within thatfield. There shouldn’t be an issue, but make sure to double check the GA dashboard to make sure that it is being recognized.
Best regards,
Jordan ShannonApril 19, 2017 at 10:52 pm #780201thank you so much! Much appreciated :)
April 19, 2017 at 11:10 pm #780206Hi,
No problem at all. If you need additional help, let us know here in the forums.
Best regards,
Jordan ShannonJuly 10, 2017 at 3:26 am #818504Hello All,
I am adding drip to my website, and just found this post in the forums. Drip asks me to add the code to every page. Do I just need to add it once in the google analytics pane?
Their instructions: “Install the following snippet of Javascript on every page of your website right before the closing </body> tag. You should include this code even on pages where you aren’t displaying any Drip forms so that we can accurately track visitor stats for you.”
I have it as below – I have pasted the drip code (starting with <! …) beneath the google analytics code (UA-80491109-1) in the pane – is this right?
Thanks,
LW
UA-80491109-1
<!– Drip –>
<script type=”text/javascript”>
var _dcq = _dcq || [];
var _dcs = _dcs || {};
_dcs.account = ‘5944406’;(function() {
var dc = document.createElement(‘script’);
dc.type = ‘text/javascript’; dc.async = true;
dc.src = ‘//tag.getdrip.com/5944406.js’;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(dc, s);
})();
</script>- This reply was modified 7 years, 4 months ago by Lknows.
July 10, 2017 at 5:41 am #818542Hi,
Please try this in your child theme functions.php file:
function brilliantl_add_drip(){ ?> <script type=”text/javascript”> var _dcq = _dcq || []; var _dcs = _dcs || {}; _dcs.account = ‘5944406’; (function() { var dc = document.createElement(‘script’); dc.type = ‘text/javascript’; dc.async = true; dc.src = ‘//tag.getdrip.com/5944406.js’; var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(dc, s); })(); </script> <?php } add_action('wp_footer', 'brilliantl_add_drip');
Best regards,
RikardJuly 10, 2017 at 5:10 pm #818876Hi Rikard,
Thank you!
I have figured out that there’s no need to paste in the code -that Drip has a plugin. I downloaded it and it seems to be working fine. Thank you.
Yours,
L
July 10, 2017 at 6:01 pm #818900Hi,
We’re glad you got that sorted out! :)
Do you still need help with this topic, or can we close this thread?
Best regards,
SarahJuly 10, 2017 at 6:58 pm #818938Yes – please close. Thank you.
L
July 10, 2017 at 8:33 pm #818967Hi,
I’m glad you were able to get this figured out. If you need addtional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘where can I add a script to track visitor behaviors for email marketing?’ is closed to new replies.