Plugin Directory

Changeset 3224346


Ignore:
Timestamp:
01/17/2025 03:10:19 PM (15 months ago)
Author:
openmost
Message:

update doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • datalayer/tags/1.0.1/readme.txt

    r3224326 r3224346  
    2929Easy access to your archive data with a standard event name and subject.
    3030
    31 ```javascript
     31<code>
    3232{
    3333    "event": "view_archive_date", //_date may be replaces with _tax value
     
    4848    }
    4949}
    50 ```
     50</code>
    5151
    5252= Author page `dataLayer` structure =
     
    5454Easy access to all author details on his archive page.
    5555
    56 ```javascript
     56<code>
    5757{
    5858    "event": "view_author",
     
    7070    }
    7171}
    72 ```
     72</code>
    7373
    7474= Error page `dataLayer` structure =
     
    7777What a great trick yeah?
    7878
    79 ```javascript
     79<code>
    8080{
    8181    "event": "view_error_404",
     
    9090    }
    9191}
    92 ```
     92</code>
    9393
    9494= Search results page `dataLayer` structure =
     
    9797Very useful for Matomo Tag Manager, and nice hack for Google Tag Manager.
    9898
    99 ```javascript
     99<code>
    100100{
    101101    "event": "view_search_results",
     
    116116    }
    117117}
    118 ```
     118</code>
    119119
    120120= Home, Post Type `dataLayer` structure (blog posts, custom post type single page) =
     
    122122The following structure is generated for a single post page, but it automatically adapts to your custom post type, page, etc.
    123123
    124 ```javascript
     124<code>
    125125{
    126126    "event": "view_single_post",
     
    194194    }
    195195}
    196 ```
     196</code>
    197197
    198198= Term and taxonomy page `dataLayer` structure =
     
    200200
    201201
    202 ```javascript
     202<code>
    203203{
    204204    "event": "view_archive_category", // this event name changed for every taxonomy
     
    219219    }
    220220}
    221 ```
     221</code>
    222222
    223223= Pagination `dataLayer` structure =
     
    227227Easy access to your pagination data, detect if users are using your pagination as much as you want.
    228228
    229 ```javascript
     229<code>
    230230{
    231231    pagination: {
     
    237237    }
    238238}
    239 ```
     239</code>
    240240
    241241= Authenticated user `dataLayer` structure =
     
    245245User hashed data with SHA256 is very useful for GDPR consent with Google Ads services and user provided data.
    246246
    247 ```javascript
     247<code>
    248248{
    249249    user: {
     
    262262    }
    263263}
    264 ```
     264</code>
    265265
    266266= Plugin : Contact Form 7 `dataLayer` structure =
     
    271271Form submitted
    272272
    273 ```javascript
     273<code>
    274274{
    275275    "event": "wpcf7_submit",
     
    277277    "wpcf7_form_detail": {} // See wpcf7_form_details below
    278278}
    279 ```
     279</code>
    280280
    281281Form with invalid fields
    282282
    283 ```javascript
     283<code>
    284284{
    285285    "event": "wpcf7_invalid",
     
    287287    "wpcf7_form_detail": {} // See wpcf7_form_details below
    288288}
    289 ```
     289</code>
    290290
    291291Form spamming detected
    292292
    293 ```javascript
     293<code>
    294294{
    295295    "event": "wpcf7_spam",
     
    297297    "wpcf7_form_detail": {} // See wpcf7_form_details below
    298298}
    299 ```
     299</code>
    300300
    301301Email sent successfully
    302302
    303 ```javascript
     303<code>
    304304{
    305305    "event": "wpcf7_mail_sent",
     
    307307    "wpcf7_form_detail": {} // See wpcf7_form_details below
    308308}
    309 ```
     309</code>
    310310
    311311Failed to send mail
    312312
    313 ```javascript
     313<code>
    314314{
    315315    "event": "wpcf7_mail_failed",
     
    317317    "wpcf7_form_detail": {} // See wpcf7_form_details below
    318318}
    319 ```
     319</code>
    320320
    321321As each event handles `wpcf7_form_details`, here is an example of the object values when the form is submitted with invalid fields.
    322322
    323 ```javascript
     323<code>
    324324"wpcf7_form_detail": {
    325325        "contactFormId": 145,
     
    364364        }
    365365    }
    366 ```
     366</code>
    367367
    368368= Plugin : WP Forms `dataLayer` structure =
    369369
    370 ```javascript
     370<code>
    371371{
    372372    event: 'wp_forms_submit',
    373373    wp_forms_form_detail: {} // the HTML tag found in DOM
    374374}
    375 ```
     375</code>
    376376
    377377
     
    391391for a following `datalayer` object:
    392392
    393 ```javascript
     393<code>
    394394{
    395395    "event": "view_single_post",
     
    409409    }
    410410}
    411 ```
     411</code>
    412412
    413413To collect the post type label, you will need to enter the value `page.post_type.label` in your custom variable.
Note: See TracChangeset for help on using the changeset viewer.