Event Tracking on Location Pages

Home Forums Store Locator Plus Event Tracking on Location Pages

This topic contains 5 replies, has 2 voices, and was last updated by  Cici 1 year ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35861

    Brady
    Participant

    Hello,

    I am trying to add Google Analytics event tracking to email and phone number clicks on our location page template.

    Here is the code I setup:

    EDIT:
    Looks like I can’t paste the code because it thinks I’m trying to do cross-site-scripting (hacking). The code can be found here: http://pastebin.com/WJHR0EiX

    Any idea how I can make this work? Thank you in advance for the help!

    • This topic was modified 1 year ago by  Brady.
    Attachments:
    You must be logged in to view attached files.
    #35865

    Brady
    Participant

    When the page loads, it does populate the phone number correctly, but does not populate the store name in the GA tracking code.

    #35902

    Cici
    Keymaster

    You can add the code in the forum here  by using the formatting under “text” with commands  /code or block quotes

    #35911

    Brady
    Participant

    I tried using the /code, but because the code included “on click”, this server thought I was trying to hack something and brought me to the firewall warning page. That’s why I posted the pastebin link.

    #35956

    Cici
    Keymaster

    Hi Brady,

    Look at the tips and examples in the Results Layout under Locator Layout

    a  question and results in the forum about what is going between the double quotes:

    /forums/topic/display-both-a-store-page-link-and-a-website-link/#post-35955

     

    More information about the Codex and Shortcodes can be found in Wp Shortcodes API putput

    #35985

    Cici
    Keymaster

    Brady,

    WP does not allow quoted shortcodes inside of quotes that you had in your pastebin: `.<a href=”tel:[storepage field=sl_phone]” onclick=”ga(‘send’, ‘event’, ‘bio-call’, ‘[storepage field=sl_store]’);”><img src=”/wp-content/uploads/bio-btn-call.png” alt=”” /></a>
    `
     

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.