• Hello!
    How can I get the visitor IP and use it as an userID on analytics and push it on an hidden input on my form?
    I’ve enabled UserID reporting in Google Analytics and checked the Visitor IP on the pugin but my view doesn’t show anything.

    Just for better understanding of my project:
    I have a website for lead generation, after clicking a campaign on facebook the person fill this contact form (contact form 7) on this page https://mapcellfranquia.com.br/ and the user data goes to my CRM, and I wish to have the userID funcion on analytics and be able to see that same userID on my CRM so I can see who became a conversion.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    When I open your site I can see the visitorIP variable in the data layer with my IP address.

    To add this into a hidden field in your form you will need to create a custom JavaScript code with your developer to read this IP address and add it into a hidden form field.

    If your developer wants to create a JS code outside of GTM, the following line of code can be used to read the variable:

    google_tag_manager["GTM-57N83NW"].dataLayer.get("visitorIP")

    Thread Starter paularillo

    (@paularillo)

    Thank you for your reply Thomas.

    I’ve tried creating a custom HTML variable on GTM to insert on a hidden field with ID “hidId” the visitorIP by calling my GTM variable “visitorIP” with this code:
    <script type=”application/javascript”>
    var hidId = document.querySelector(“#hidId”);
    hidId.value={{visitorIP}};
    </script>

    And it didn’t worked, also tried adding this code to my page, and it didn’t work also:
    <script type=”application/javascript”>
    var hidId = document.querySelector(“#hidId”);
    hidId.value=google_tag_manager[“GTM-57N83NW”].dataLayer.get(“visitorIP”);
    </script>

    Any idea what i’m doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User ID on contact form 7 lead generation’ is closed to new replies.