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

    (@duracelltomi)

    Hi,

    I am sorry but this is not enough to be able to help.
    What is the exact value of the $contact_txt variable?
    Could you post a live example URL of the issue?
    When you enable debug mode of your container do you see the corresponding tag to fire?

    Cheers,
    Thomas

    Thread Starter pascalflamand

    (@pascalflamand)

    Sorry my code lines didn’t show properly:

    There you go:
    <?php echo '<a class="top-cta-contact" href="'.$contact_url.'" onclick="dataLayer.push({\'event\':\'CTA\', \'eventCategory\': \'Header-Contactez-Nous\', \'eventAction\':\'clic\',\'eventLabel\': Contactez-nous})">'.$contact_txt.'</a>'; ?>

    In debug mode it doesn’t fire … I use Google Analytics Debugger and it shows me this jquery.js warning in the console:

    event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

    The website is Ultime Café. The data layer is on the header “contactez-nous” button

    It would be awesome to fix it.

    Thank

    Plugin Author Thomas Geiger

    (@duracelltomi)

    I checked your site.

    There is for example a contact us link on the top of the page with the following onclick event:

    onclick=”dataLayer.push({‘event’:’CTA’, ‘eventCategory’: ‘Header-Contactez-Nous’, ‘eventAction’:’clic’,’eventLabel’: Contactez-nous})”

    There is a syntax error in it because you did not quote the string: Contactez-nous

    Here is the correct code:
    onclick=”dataLayer.push({‘event’:’CTA’, ‘eventCategory’: ‘Header-Contactez-Nous’, ‘eventAction’:’clic’,’eventLabel’: ‘Contactez-nous’})”

    Does this answer your question?

    Cheers,
    Thomas

    Thread Starter pascalflamand

    (@pascalflamand)

    Wow I’m very sorry. So simple, in front of my eye. :S

    Thank you !!!!

    Thread Starter pascalflamand

    (@pascalflamand)

    Resolved 🙂

    Hi,
    Can anyone please help me?

    I’m using dataLayer.push() method for download tracking.

    analyticsID = ‘xxx’;
    onclick:”dataLayer.push({‘event’: ‘GAEvent’, ‘eventCategory’:’Downloads’, ‘eventAction’: ‘xxx’, ‘eventLabel’: ‘xxx’ , ‘DownloadID’: analyticsID});”

    per day I got a logs for 400 to 450 downloads. But the tracking is happening in between 360 t0 400 downloads. Approximately 40 to 50 trackings are missing in analytics.

    If I will be resolved with in today, that would be appreciated.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    This support forum is now only for questions and requests for my Google Tag Manager WordPress plugin.

    You can post your general GTM question in the official GTM product forum:
    https://productforums.google.com/forum/#!forum/tag-manager

    Thanks,
    Thomas

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Tracking event via datalayer.push problem’ is closed to new replies.